novah.computation
This module defines computation expressions for some types like List and Option.
Types
Declarations
list
visibility: public
type: { combine : List a -> List a -> List a, for : List a -> (a -> List b) -> List b, yield : a -> List a, zero : List a }
The builder for list computation expressions.
Allows to use do.list
syntax for list comprehensions.
set
visibility: public
type: { combine : Set a -> Set a -> Set a, for : Set a -> (a -> Set b) -> Set b, yield : a -> Set a, zero : Set a }
The builder for set computation expressions.
Allows to use do.set
syntax for set comprehensions.
linkedList
visibility: public
type: { combine : LinkedList a -> LinkedList a -> LinkedList a, for : LinkedList a -> (a -> LinkedList b) -> LinkedList b, yield : a -> LinkedList a, zero : LinkedList a }
The builder for linked list computation expressions.
Allows to use do.linkedList
syntax for linked list comprehensions.
optCombine
visibility: private
type: Option a -> Option a -> Option a
option
visibility: public
type: { bind : Option a -> (a -> Option b) -> Option b, combine : Option a -> Option a -> Option a, return : a -> Option a, zero : Option a }
The builder for optional computation expressions.
Allows to use do.option
syntax for option workflows.
resultBind
visibility: private
type: Result a err -> (a -> Result b err) -> Result b err
resultCombine
visibility: private
type: Result ok err -> Result ok err -> Result ok err
result
visibility: public
type: { bind : Result a e -> (a -> Result b e) -> Result b e, combine : Result a e -> Result a e -> Result a e, return : a -> Result a e }
The builder for success/error computation expressions.
Allows to use do.result
syntax for failable workflows.