FunctorLayer[M, Inner] has the following functionality:
- lifts values from the FunctorInner to the FunctorM.
- lifts Functor isomorphisms in Inner ((Inner ~> Inner, Inner ~> Inner))
into Functor homomorphisms in M (M ~> M).
This allows you to "map" a natural transformation over the Inner inside M,
but only if you can provide an inverse of that natural transformation.
FunctorLayer has one free law, i.e. a law guaranteed by parametricity:
def layerRespectsMap[A, B](in: Inner[A])(f: A => B) = {
layer(in.map(f)) <-> layer(in).map(f)
} // this is free because all `FunctionK`'s (including `layer`, despite not being an instance of the class)// are natural transformations (i.e., they follow this law exactly)
FunctorLayer[M, Inner]
has the following functionality: - lifts values from theFunctor
Inner
to theFunctor
M
. - liftsFunctor
isomorphisms inInner
((Inner ~> Inner, Inner ~> Inner)
) intoFunctor
homomorphisms inM
(M ~> M
). This allows you to "map" a natural transformation over theInner
insideM
, but only if you can provide an inverse of that natural transformation.FunctorLayer[M, Inner]
has two external laws:FunctorLayer
has one free law, i.e. a law guaranteed by parametricity: