as_maybe: Convert value of any type to a Maybe type

Description Usage Arguments Format Value See Also Examples

Description

In functional programming, this function would be called "return" as it *returns* a value of type Maybe. To avoid name collision, and to follow the convention for existing types, the coversion function is instead named "as_maybe"

Usage

1

Arguments

a

Any type of value

Format

as_maybe :: a -> Maybe a

Value

A Maybe type

See Also

Other Maybe functions: is_nothing, maybe_apply, maybe_bind, maybe_default, maybe_map_2, maybe_map_3, maybe_map_4, maybe_map_5, maybe_map, maybe_then, maybes_collapse, maybes_partition

Examples

1
2
3
as_maybe(42) # Just(42)
as_maybe(Just(42)) # Just(Just(42))
as_maybe(NULL) # Nothing()

Teresa00/hfmAnnotation documentation built on May 14, 2019, 12:51 a.m.