escape 0.0.1

Released 2017-03-04.

To install, run:

haxelib install escape 0.0.1

See using Haxelib in Haxelib documentation for more information.

Maintainerdeep
Website
Current version0.0.1
StatisticsInstalled 1 times
LicenseMIT
Tags cross, utils

README.md

Scala inspired Try operator

Build Status

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 deep.dhx.Try.Macro.Try;   // macro magic
using deep.dhx.TryTools;        // 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