[Haskell-cafe] let vs do?

Greg Meredith lgreg.meredith at biosimilarity.com
Thu Jun 28 16:02:09 EDT 2007


Thomas,

Thanks for the reply. My thinking was that once you have a polymorphic form,
why single out any other? Less moving parts makes for less maintenance, etc.

Best wishes,

--greg

On 6/28/07, Thomas Schilling <nominolo at googlemail.com> wrote:
>
>
> On 28 jun 2007, at 21.17, Greg Meredith wrote:
> >
> > Once you have a polymorphic let, why do you need 'let' in the base
> > language, at all? Is it possible to formulate Haskell entirely with
> > do-notation where there is a standard monad for let environments?
> > Probably this was all discussed before in the design deliberations
> > for the language standard. Pointers would be very much appreciated.
> >
>
>    let x = ... in ...
>
> is only equal
>
>    do x <- ...; ...
>
> in the Identity monad.  Also, why would "do" be more primitive than
> "let".  That way you would have to use monads everywhere.  Also, let
> is treated specially by the type checker (IIRC) and there are many,
> many other reasons not to do that.
>
> Why would you consider the syntactic sugar do { x <- e; .. } which is
> just a different way of writing function binding (e >>= \x -> ...)
> consider more primitive than "let"?
>
> / Thomas
>
>
>


-- 
L.G. Meredith
Managing Partner
Biosimilarity LLC
505 N 72nd St
Seattle, WA 98103

+1 206.650.3740

http://biosimilarity.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20070628/1d227643/attachment-0001.htm


More information about the Haskell-Cafe mailing list