fun_land v0.7.3 FunLand.Builtin.Map

Maps are Mappable, because we can map over {k, v}-tuples to create new values.

Maps are however not Appliable, as there is no clearly

Maps are not Applicative, as there is no way to put ‘a value’ inside a map (we don’t know what key to associate it with) so we cannot define an implementation of wrap/2.


Maps are Combinable, as we can take two key-value pairs, and combine them. It is also possible to create a neutral element: an empty map.

Summary

Functions

A variant of reduce/3 that accepts anything that is Combinable as second argument. This Combinable will determine what the neutral value and the combining operation will be

Converts the reducable into a list, by building up a list from all elements, and in the end reversing it

Functions

combine(map_a, map_b)
map(map, function)
neural()
reduce(a, combinable)

A variant of reduce/3 that accepts anything that is Combinable as second argument. This Combinable will determine what the neutral value and the combining operation will be.

reduce(map, initial, folding_function)

Callback implementation for FunLand.Reducable.reduce/3.

to_list(reducable)

Converts the reducable into a list, by building up a list from all elements, and in the end reversing it.

This is an automatic function implementation, made possible because Elixir.FunLand.Builtin.Map implements the FunLand.Reducable behaviour.