Skip to content

Instantly share code, notes, and snippets.

@Icelandjack
Last active November 21, 2018 19:05
Show Gist options
  • Save Icelandjack/9e6902690a244286843164e554a8c3db to your computer and use it in GitHub Desktop.
Save Icelandjack/9e6902690a244286843164e554a8c3db to your computer and use it in GitHub Desktop.
Monoidal natural transformations / Applicative morphisms / Applicative functor morphism / Applicative transformation (used in Data.Foldable)

https://mail.haskell.org/pipermail/haskell-cafe/2010-November/086055.html

http://conal.net/blog/posts/simplifying-semantics-with-type-class-morphisms

http://conal.net/blog/posts/another-lovely-example-of-type-class-morphisms

https://arxiv.org/pdf/1202.2919.pdf

eta (pure c) = pure c
eta (f <*> x) = eta f <*> eta x

Applicative (Sum f g): https://gist.github.com/Icelandjack/78542ddbdb622a48d8e60e14510cd7dd

Examples

In addition to these we have some uninteresting ones.

I don't think there are any transformations Maybe ~> (m, ) but there is (a unique?) one

a :: (m, ) ~> Maybe
a (_, m) = Just m
@Icelandjack
Copy link
Author

? Monad morphism implies applicative morphism

@Icelandjack
Copy link
Author

A Uni ed View of Monadic and Applicative Non-determinism

@Icelandjack
Copy link
Author

A Uni ed View of Monadic and Applicative Non-determinism

Ideal monad / idealized monad / unital monads

Control.Applicative.Lift + https://www.reddit.com/r/haskell/comments/6ac1x2/idealised_monads_or_monad_instance_for_lift_f/

data UM m a = Pure a | Impure (m a)

class Functor m => Unital m where
  join :: m (UM m a) -> UM m a

@Icelandjack
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment