option package:threepenny-gui

One or none. It is useful for modelling any computation that is allowed to fail.

Examples

Using the Alternative instance of Control.Monad.Except, the following functions:
>>> import Control.Monad.Except
>>> canFail = throwError "it failed" :: Except String Int

>>> final = return 42                :: Except String Int
Can be combined by allowing the first function to fail:
>>> runExcept $ canFail *> final
Left "it failed"

>>> runExcept $ optional canFail *> final
Right 42