fun_land v0.8.0 API Reference

Modules

FunLand defines many different Algebraic Data Types

Delegation module to be invoked when one of the FunLand behaviour-specifications is called with an Atom as argument

Delegation module to be invoked when one of the FunLand behaviour-specifications is called with a Float as argument

Delegation module to be invoked when one of the FunLand behaviour-specifications is called with an Integer as argument

Maps are Mappable, because we can map over {k, v}-tuples to create new values. ( Note that different from the Map implementation of Enum.map, the result should be a new value, and not a new {key, value}-tuple. There is no way to alter the key while mapping over a Map, as the key is part of the structure, rather than its contents! )

Delegation module to be invoked when one of the FunLand behaviour-specifications is called with a PID as argument

Delegation module to be invoked when one of the FunLand behaviour-specifications is called with a Port as argument

Delegation module to be invoked when one of the FunLand behaviour-specifications is called with a Reference as argument

Uses {:ok, value} | :error | {:error, error} as representation of the Either type

Defines a ‘chain’ operation to apply a function that takes a simple value and outputs a new Chainable to a value inside a Chainable

If an operation is can combine two elements, and there is a clearly defined empty empty version that can be used to keep the same element when used on an element

Things that are both combinable and a monad

FunLand Helper functions for some common Algorithmic Data Type implementations

Something is Mappable if there is a way to map a function over it

A Monad: a sequence of operations inside a context

Anything that implements the Reducable behaviour, can be reduced to a single value, when given a combinable (or combining-function + base value)

An operation is Semiombinable if you can combine two values using it, but there is no clearly defined neutral thing which you can combine with an element to obtain itself

WARNING: This module is not completely stable yet, and should therefore not be used in practice yet

Under FunLandic, you can find many practical implementations of different Algebraic Data Types

This Combinable can be used to combine a Reducable of boolean values, returning true if all of them are true

This Combinable can be used to combine a Reducable of boolean values, returning true if any of them (e.g. at least one of them) is true

An implementation of the “Either” monad

The Identity ADT is a wrapper around a single element

Product wraps numbers. Each Product struct is a wrapper around a single number, and basically says: ‘I want to treat this number as something that, when combined with another number, should be multiplied, using 1 as empty element’

The Reader monad wraps a function that returns the contained value when asked. This is nice, as you can call things inside the Reader context, and only refer to the things inside the Reader when you require them. It thus enables lighter parameter-passing

Sum wraps numbers. Each Sum struct is a wrapper around a single number, and basically says: ‘I want to treat this number as something that, when combined with another number, should be summed, using 0 as empty element’