Functor module:Data package:linear-base
Linear Data Functors should be thought of as containers holding values
of type a over which you are able to apply a linear function
of type a %1-> b on each value of type a
in the functor and consume a given functor of type f a.
A Profunctor can be thought of as a computation that involves taking
a(s) as input and returning
b(s). These computations
compose with (linear) functions. Profunctors generalize the function
arrow
->.
Hence, think of a value of type
x arr y for
profunctor
arr to be something like a function from
x to
y.
Laws:
lmap id = id
lmap (f . g) = lmap f . lmap g
rmap id = id
rmap (f . g) = rmap f . rmap g