import { NatEitherOption } from "https://deno.land/x/fun@v2.0.0/examples/natural.ts";
Now lets define some Natural Transformations. The rule we have to follow is:
NaturalTransform<V, U> . Functor === Functor . NaturalTransform<V, U>
This is like saying (U = Either, V = Option):
pipe( right("Hello World"), Either.map(str => str.length), NaturalTransformation<Either, Option>.transform, )
Must equal:
pipe( right("Hello World"), NaturalTransform<Either, Option>.transform, Option.map(str => str.length), )