Skip to content

Instantly share code, notes, and snippets.

@akanehara
Last active December 14, 2015 15:48
Show Gist options
  • Save akanehara/5110329 to your computer and use it in GitHub Desktop.
Save akanehara/5110329 to your computer and use it in GitHub Desktop.
{-# LANGUAGE XNoMonomorphismRestriction #-}
import Control.Monad
newtype Foo m a b = Foo (m a -> (a -> m b))
instance (Monad m) => Monoid (Foo m a b) where
mempty = return
mappend x y = x <=< y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment