[Haskell] Re: Global Variables and IO initializers

Benjamin Franksen benjamin.franksen at bessy.de
Thu Nov 4 12:31:31 EST 2004


On Thursday 04 November 2004 18:28, Koen Claessen wrote:
> Ben Rudiak-Gould wrote:
>  | I think the OP is proposing the same thing, except
>  | without the ellipsis: i.e. we just write
>  |
>  |     pretty :: Doc -> String
>  |
>  | and the compiler infers pretty :: (?width :: Int) => Doc
>  | -> String, or whatever. This actually sounds like a very
>  | good idea to me.
>
> I think hiding the fact that certain objects are not
> constants but functions is a bad idea, because it will break
> sharing in a lazy implementation.

You probably mean the case where the implicit parameter is the only one. I 
don't see why that would "break sharing in a lazy implementation". The 
compiler is fully aware of the complete type of all functions and can use 
sharing whenever appropriate.

Ben


More information about the Haskell mailing list