Hike
The Hike
module provides an implementation of the Optional data types.
It defines
-
a struct
Hike.Option
with a single fieldvalue
which can either benil
or any other value of typet
. -
a struct
Hike.Either
that represents an "either/or" value. It can contain either aleft
value or aright
value, but not both -
a struct
Hike.MayFail
that represents an "either/or" value. It can contain either aFailure
value or aSuccess
value, but not both.
This implementation provides shorthand functions to work with Optional data, including mapping, filtering, applying and many more functions to the value inside the Optional data.
Installation
If available in Hex, the package can be installed
by adding hike
to your list of dependencies in mix.exs
:
def deps do
[
{:hike, "~> 0.0.1"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/hike.