Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Icelandjack
Created September 23, 2017 16:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Icelandjack/1bc5039180b3c8707983b1682e7245fd to your computer and use it in GitHub Desktop.
Save Icelandjack/1bc5039180b3c8707983b1682e7245fd to your computer and use it in GitHub Desktop.
Paper: Stuff that has to be mentioned

This would be sweet to have:

instance Category cat => Monoid (Join cat a) where
  mempty = Join id

  Join f `mappend` Join g = Join (f . g)

and where we can define

newtype Kleisli m a b = Kleisli (a -> m b)
  deriving via (a ~ b => Join (Kleisli m) a b)
    (Monoid)

instance Monad m => Category (Kleisli m)
@Icelandjack
Copy link
Author

Icelandjack commented Sep 24, 2017

Applicative (Sum f g) gist

This is quite cool for Applicative (Sum f g) and Monad (Compose f g)

newtype MM a = MM (Maybe (Maybe a))
  deriving via (Comp "seq" Maybe Maybe a)
    (Functor, Applicative, Monad)

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