Interesting https://www.reddit.com/r/haskell/comments/1u8rp1/with_two_different_functors/
Description of monoidal natural transformations https://gist.github.com/Icelandjack/9e6902690a244286843164e554a8c3db
Interesting https://www.reddit.com/r/haskell/comments/1u8rp1/with_two_different_functors/
Description of monoidal natural transformations https://gist.github.com/Icelandjack/9e6902690a244286843164e554a8c3db
"Perfect Trees and Bit-reversal Permutations" (Ralf Hinze) points out that functor composition distributes left through sums
-- iso
Compose (Sum g g') f <~> Sum (Compose g f) (Compose g' f)
but distributing right goes one way,
Sum (Compose f g) (Compose f g') ~> Compose f (Sum g g')
But when does this make sense?
from' :: AppHom g g' -> Compose Pair (Sum g g') a -> Sum (Compose Pair g) (Compose Pair g') a
from' nat (Compose (InL xs :# InL ys)) = InL (Compose (xs :# ys))
from' nat (Compose (InL xs :# InR ys)) = InR (Compose (nat xs :# ys))
from' nat (Compose (InR xs :# InL ys)) = InR (Compose (xs :# nat ys))
from' nat (Compose (InR xs :# InR ys)) = InR (Compose (xs :# ys))
http://www.cs.ox.ac.uk/jeremy.gibbons/publications/ringads.pdf
The well-behaved operations over monadic values are called the algebras for that monad—functions
k
such thatk . return = id
andk . mult = k . fmap k
. In particular,join
is itself a monad algebra.