I'm trying to install an application Termite - Util but I get this error in with the line 14
newtype CE m a = CE {unCE :: m a} deriving (Monad)
The error says:
ContextError.hs:14:45: No instance for (Applicative (CE m)) arising from the 'deriving' clause of a data type declaration Possible fix: use a standalone 'deriving instance' declaration, so you can specify the instance context yourself When deriving the instance for (Monad (CE m))
I have alredy try with the solution proposed in CIS 194: Homework 7
adding this:
instance Applicative (CE m) where pure = return (<*>) = ap
but I get this error again
ContextError.hs:14:45: No instance for (Functor (CE m)) arising from the 'deriving' clause of a data type declaration Possible fix: use a standalone 'deriving instance' declaration, so you can specify the instance context yourself When deriving the instance for (Monad (CE m))
I really don't know how to proceed, I'm new with Haskell
Thanks in advance.
In ghc 7.10.1 AMP proposal took place. Prior to that you could define Monad
instance without having Applicative
instance, after 7.10.1 you have to define Functor
and Applicative
if you want to define a Monad
.
https://wiki.haskell.org/Functor-Applicative-Monad_Proposal
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With