Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
How can I get:
*** Exception: src/Language/Hask/Compiler/Monad.hs:23:10-31: No instance nor default method for class operation message
when using fail derived using newtype strategy, when I'm sure underlying monad provides working one?
fail
newtype
I've even tried implementing it myself... like, it works just fine when I try it with monad inside...
code sample?
newtype Parser a = Parser{ unParser :: ReaderT Options (M.Parsec Void Text) a } deriving newtype ( Alternative, Applicative, Functor, Monad, M.MonadParsec Void Text , MonadPlus ) instance MonadFail Parser where fail = Parser . fail
which Parsec?
Oh, wait a second, I misread the error :sweat_smile:
"class operation message"??
do you have -fdefer-type-errors on?
-fdefer-type-errors
I'm tired and stupid - it's different module and just happens to point to my deriving clause! I'm missing method definitions in unrelated code :joy:
and I just took your word for what the problem was :sweat_smile:
And I omitted part of relevant context, sorry for that :sweat_smile:
How can I get:
when using
fail
derived usingnewtype
strategy, when I'm sure underlying monad provides working one?I've even tried implementing it myself... like, it works just fine when I try it with monad inside...
code sample?
which Parsec?
Oh, wait a second, I misread the error :sweat_smile:
"class operation message"??
do you have
-fdefer-type-errors
on?I'm tired and stupid - it's different module and just happens to point to my deriving clause!
I'm missing method definitions in unrelated code :joy:
and I just took your word for what the problem was :sweat_smile:
And I omitted part of relevant context, sorry for that :sweat_smile: