[web-devel] Setting variables in hamlet forall

Yitzchak Gale gale at sefer.org
Sun Apr 10 12:02:14 CEST 2011

Mark Bradley wrote:
>> $with definitely differentiates it from the way that haskell does let
>> binding and even makes it more obvious about the scoping (with
>> bindings in languages like python/javascript work this way), even
>> hinting that it doesn't to pattern matching.

You don't need to wander to Python and JS. "With" is a
well-established idiom in Haskell. Just hoogle "with" and
you'll see. This usage fits in with that perfectly.

Michael Snoyman wrote:
> for consistency, I'll use <- instead of =.

I'm not a user of this, so I am not expressing an opinion
here. But just as an information point, <- is not consistent
with the usual Haskell "with" idiom either. All of the other
examples would use "$". I.e., "with" is a function, not new
syntax. "$forall" reminds me of list comprehensions, which
is why <- looks natural to me there.


More information about the web-devel mailing list