Может кто помочь? Решаю задачки из
https://leanpub.com/purescript/read#leanpub-auto-superclassesЗадача 4, решение:
https://leanpub.com/purescript/read#leanpub-auto-superclassesclass Monoid m <= Action m a where
act :: m -> a -> a
newtype Self m = Self m
instance selfAction :: Action m (Self m) where
act m (Self a) = Self (m <> a)
Ругается:
No type class instance was found for
Data.Monoid.Monoid m0
while checking that expression #dict Monoid
has type { mempty :: m0
, "Semigroup0" :: {}
-> { append :: m0 -> m0 -> m0
}
}
in value declaration selfAction
where m0 is a rigid type variable
bound at (line 0, column 0 - line 0, column 0)
Не понимаю смысл ошибки.