Estou tentando criar meu próprio tipo de dados, que fará parte da classe Monad, mas newtype Container a = Container a deriving Monad me dá este erro: * Can't make a derived instance of `Monad Container' (even with cunning GeneralizedNewtypeDeriving): cannot eta-reduce the representation type enough * In the newtype …
Eu tenho uma dúzia de tipos novos como este: newtype MyBool = MyBool Bool newtype MyInt = MyInt Int Quero reutilizar instâncias existentes: instance MArray IOUArray Int IO where ... instance MArray (STUArray s) Int (ST s) where ... Implementar essas instâncias e ter todo o código padrão é a …