Std.Functor
View source →Functor protocol for structures that support fmap.
A functor is any container that admits a structure-preserving
map. The built-in impl for List delegates to Std.List.map/2;
additional impls can be declared for user-defined container
types.
Examples
use Std.Functor
fmap([1, 2, 3], fn(x) -> x + 10) # => [11, 12, 13]
Protocols
-
proto Functor(F)Functor(F)lifts an arbitrary functionA -> Bto an endo-transformation on a containerF.