Wording of type error

Alastair Reid reid at cs.utah.edu
Thu Apr 26 21:21:27 EDT 2001


This binding:

  ...
   where
    ...
    glue' = map mkGlue glue
    ...

generated the following type error which is correct except:

1) glue' is clearly _not_ a function but the last line of the message
   refers to it as a function.

   (There's a small chance that things are being confused by my OTT
   use of implicit parameters in this module - but even if it really
   _is_ a function (because there's an implicit parameter), it sure 
   doesn't look like one.)

2) The use of ` and ' around the identifier doesn't work too well if
   the identifier ends in a '.  It'd be better to use " since " isn't
   legal in identifiers.  (Of course, you might run into trouble if
   printing a string literal.)

  TcUnits.hs:97:
    Couldn't match
        `AbstractUnits.UnitIdent' against `AbstractUnits.Glue'
        Expected type: [AbstractUnits.UnitIdent]
        Inferred type: [AbstractUnits.Glue]
    In the second argument of `map', namely `glue'
    in the definition of function `glue'': map mkGlue glue
   


-- 
Alastair Reid        reid at cs.utah.edu        http://www.cs.utah.edu/~reid/




More information about the Glasgow-haskell-bugs mailing list