[Haskell-cafe] To "instance C D", GHCI responds that C "is applied to too many type arguments".

Jeffrey Brown jeffbrown.the at gmail.com
Sat Jun 13 18:42:02 UTC 2015


Solved it. The problem was that in the class declaration I should include a
type variable.

jeff at jeffLenovUbu:~/work/computer/dwt/haskell$ ghci -XNullaryTypeClasses
GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> data D = DConstructor
Prelude> class C a -- earlier I omitted the a; that seems to have been the
problem
Prelude> instance C D
Prelude>


On Sat, Jun 13, 2015 at 12:03 AM, Jeffrey Brown <jeffbrown.the at gmail.com>
wrote:

> jeff at jeffLenovUbu:~$ ghci -XNullaryTypeClasses
> GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
> Loading package ghc-prim ... linking ... done.
> Loading package integer-gmp ... linking ... done.
> Loading package base ... linking ... done.
> Prelude> class C
> Prelude> data D = DConstructor
> Prelude> instance C D
>
> <interactive>:4:10:
>     ‘C’ is applied to too many type arguments
>     In the instance declaration for ‘C D’
> Prelude>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20150613/a4b9b503/attachment.html>


More information about the Haskell-Cafe mailing list