dhx.try

Scala inspired Try operator
https://github.com/profelis/dhx.try

To install, run:

haxelib install dhx.try 0.0.4 

See using Haxelib in Haxelib documentation for more information.

README.md

Scala inspired Try operator

Build Status

Haxelib: http://lib.haxe.org/p/dhx.try/

Scala API: http://www.scala-lang.org/api/current/scala/util/Try.html

Posts: http://danielwestheide.com/blog/2012/12/26/the-neophytes-guide-to-scala-part-6-error-handling-with-try.html

Usage:

import dhx.Try;
import dhx.Try.Macro.Try;   // macro magic
using dhx.Tries;        // useful extensions
...
var tried:Try<Int> = Try(someUnsafeOperation(foo, bar));
tried.LogFailure(); // trace exception or set define `debug_try`
var value = tried.getOrElse(function () return 0);

Global Import

import.hx

import dhx.Try;
import dhx.Try.Macro.Try;
using dhx.Tries;

Debug

  • define debug_try - turn on exceptions log
Contributors
deep
Version
0.0.4
Published
1 year ago
License
MIT

All libraries are free

Every month, more than thousand developers use haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on Github!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on Github