java-bridge-0.99: Bindings to the JNI and a high level interface generator.

Portabilityportable (Haskell2010)
Stabilityprovisional
Maintainerjulian.fleischer@fu-berlin.de
Safe HaskellNone

Foreign.Java.Value

Description

The ternary value type, which can treither hold a value, nothing, or a special value describing an error condition.

Synopsis

Documentation

data Value a Source

A ternary value type to hold one of two possible value types or none at all.

Constructors

Value a

An actual value

NoValue

No value

Fail JThrowable

A value describing the error

Instances

valueSource

Arguments

:: b

default value if neither a value nor a fail value is given

-> (JThrowable -> b)

function to handle a fail value

-> (a -> b)

function to handle an actual value

-> Value a

the value

-> b

the final return value

fold on a Value, like either for Either or maybe for Maybe.