Skip to content

Instantly share code, notes, and snippets.

@paulp
Created Aug 23, 2018
Embed
What would you like to do?
instance Monad f => Monad (OptionalT f) where
f =<< x = OptionalT $ runOptionalT x >>= \case
Empty -> return Empty
Full a -> runOptionalT $ f a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment