The `Either` type is sometimes used to represent a value which is either correct or an error; by convention, the `Left` constructor
is used to hold an error value and the `Right` constructor is used to hold a correct value (mnemonic: "right" also means "correct").
"""
-data Either a b = Left a | Right b
+@JavaType "org.simantics.scl.runtime.either.Either"
+data Either a b =
+ @JavaType "org.simantics.scl.runtime.either.Left"
+ @FieldNames [value]
+ Left a
+ | @JavaType "org.simantics.scl.runtime.either.Right"
+ @FieldNames [value]
+ Right b
deriving instance (Ord a, Ord b) => Ord (Either a b)
deriving instance (Show a, Show b) => Show (Either a b)
"Executes the given expression and catches certain class of exceptions (specified by the catch handler that is given as a second parameter.)"
@JavaName catch_
- catch :: VecComp ex => (<e> a) -> (ex -> <e> a) -> <e> a
+ catch :: VecComp ex => (<e,Exception> a) -> (ex -> <e> a) -> <e> a
importJava "java.lang.Throwable" where
data Throwable