Skip to content

Instantly share code, notes, and snippets.

Created Sep 23, 2017
What would you like to do?
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)

instance Monad m => Category (Kleisli m)
Copy link

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