[GUI] I love GIO.
Dean Herington
heringto@cs.unc.edu
Wed, 12 Feb 2003 17:40:52 -0500 (EST)
On Wed, 12 Feb 2003, Daan Leijen wrote:
> [Dean wrote:]
> > Warning about the use of (:=): This symbol has been proposed by John
> > Hughes for use in some future version of Haskell to distinguish
> > monomorphic and polymorphic `let` constructs. (See, for example,
> > http://www.math.chalmers.se/~rjmh/Globals.ps , section 6.) You might
> > prefer to choose a different symbol, such as (:==) or (::=).
> Thanks for mentioning this. However, (:=) is a rather attractive
> constructor to use
Yes, indeed.
> and I wonder if a monomorphic binding is used enoug to justify taking
> another operator away.
The choice between polymorphism and sharing is fundamental enough that I
think it's worth an operator symbol (*). Of course it doesn't need to be
(:=), but it shouldn't be too weird, either.
[(*) The use in a binding construct is pure syntax, not really an
operator. In fact, I think the same symbol could (though probably not
should) be used for binding and as a general-use operator.]
> It might be better after all to have a family of "let" bindings in a
> future haskell:
> let -- lazy binding
> let! -- strict binding
> let$ -- speculative binding (ie. try operationally strictly but
> maintain lazy semantics)
> let# -- monomorphic binding ?...
That proposal doesn't work, for several related reasons:
1. A `let` may introduce multiple bindings. It's undesirable that all
such bindings be required to be of the same sort.
2. The same binding choices apply also to `where`.
3. The same binding choices apply also at the top level, where there's no
`let` or `where` keyword to decorate.
In summary, it's much cleaner to indicate the binding choice with the
symbol.
-- Dean