monomorphic or not?

John Meacham john at
Thu Mar 6 06:37:45 EST 2008

On Thu, Mar 06, 2008 at 08:56:15AM +0000, Simon Peyton-Jones wrote:
> No, it's fine.  compress is indeed monomorphic, but since it's called
> at exactly one type, namely Char, so it gets the monomorphic type
> [Char] -> [Char].  That is what the Haskell Report says. (Or tries
> to.)

But when I modify the module header to be:

> module Main(main,compress) where

It still doesn't complain, it can't know that all other uses of
'compress' in other modules will also be at a Char type.

It also seems to me that the Dependency Analysis (4.5.1 in the report) would
cause 'compress' to be typed and generalized before 'main' was even



John Meacham - ⑆⑆john⑈

More information about the Glasgow-haskell-users mailing list