[Yhc] Incomprehensible error messages

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Wed Jun 6 12:17:09 EDT 2007


"David Fox" <ddssff at gmail.com> wrote:

> What I was wondering is what those "No default for  Main.CNode"
> messages would be expected to mean.  Maybe if I could supply the
> default it claims is missing I could work around this problem.

The message refers to the standard Haskell class-defaulting mechanism
(which is only supposed to cut in when there is an ambiguous constrained
type, and one of the constraints is Num).  You can attempt to use the
user-defined defaulting feature of Haskell to workaround this
type-checker bug.  e.g.

  module Mine where
  default (Integer,Double,TNode)
  data TNode = ...

although I can't guarantee the results.

Regards,
    Malcolm


More information about the Yhc mailing list