Skip to content

Instantly share code, notes, and snippets.

@wyager
Created October 8, 2017 00:57
Show Gist options
  • Save wyager/c15c24888c017a66488e3d0f4d372905 to your computer and use it in GitHub Desktop.
Save wyager/c15c24888c017a66488e3d0f4d372905 to your computer and use it in GitHub Desktop.
> import Control.Monad.Morph
> import Control.Monad.Except
> let wrap f = hoist (withExceptT f)
> :t wrap
wrap
:: (MFunctor t, Monad m) =>
(e -> e') -> t (ExceptT e m) b -> t (ExceptT e' m) b
> let wrap = hoist . withExceptT
<interactive>:5:12: error:
• Couldn't match type ‘ExceptT e m0 a0 -> ExceptT e' m0 a0’
with ‘forall a. m a -> n a’
Expected type: (ExceptT e m0 a0 -> ExceptT e' m0 a0)
-> t m b -> t n b
Actual type: (forall a. m a -> n a) -> t m b -> t n b
• In the first argument of ‘(.)’, namely ‘hoist’
In the expression: hoist . withExceptT
In an equation for ‘wrap’: wrap = hoist . withExceptT
• Relevant bindings include
wrap :: (e -> e') -> t m b -> t n b (bound at <interactive>:5:5)
>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment