[MLton] funny error message

Henry Cejtin henry.cejtin@sbcglobal.net
Fri, 23 Sep 2005 18:12:33 -0500


Ok,  here  is  a  pretty minimal example that produces the bad error message.
Note, if you eliminate flatmap from the signature (which  also  generates  an
error) then the error for flatten is:

    Variable type in structure disagrees with signature.
      variable: flatten
      unable to generalize: 'a
      signature: 'a stream stream -> 'a stream

which is perfect.

With  flatmap  in  the signature (and so also being told to generalize beyond
what the value restriction allows), the two errors produced are:

    Variable type in structure disagrees with signature.
      variable: flatmap
      unable to generalize: 'b
      signature: ('a -> 'b stream) -> ('a stream -> 'b stream)

and

    Variable type in structure disagrees with signature.
      variable: flatten
      structure: ['a] stream stream -> ['a] stream
      signature: ['b] stream stream -> ['b] stream