Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Stefan Holdermans
Thomas, 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

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Greg Meredith
Thomas, Stefan, Thanks for a most edifying exchange! i will reflect on this. Best wishes, --greg On 6/28/07, Stefan Holdermans [EMAIL PROTECTED] wrote: Thomas, let x = ... in ... is only equal do x - ...; ... in the Identity monad. Also, why would do be more primitive than

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Arie Peterson
Dave Bayer wrote: [...] In the Haskell do expression, every line is equally special, and type information is used to combine the lines, inserting implied combinators.[...] Desugaring do-notation is a syntactic transformation, requiring no type information. (In practice, the parts may be

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Philippa Cowderoy
On Fri, 29 Jun 2007, Dave Bayer wrote: One is immediately led back to the same idea as Haskell do expressions: Two pieces of program, juxtaposed next to each other, silently multiply to combine into a larger program, with type rules guiding the multiplication process. They don't,

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread Thomas Schilling
On 29 jun 2007, at 16.26, Dave Bayer wrote: That way you would have to use monads everywhere. As you already hinted at in a later message, this has to do with let-bindings being potentially polymorphic and monadic bindings being necessarily monomorphic: Are there papers that prove this

Re: [Haskell-cafe] let vs do?

2007-06-29 Thread John Meacham
On Fri, Jun 29, 2007 at 07:26:21AM -0700, Dave Bayer wrote: On Jun 28, 2007, at 9:49 PM, Stefan Holdermans wrote: That way you would have to use monads everywhere. As you already hinted at in a later message, this has to do with let-bindings being potentially polymorphic and monadic

[Haskell-cafe] let vs do?

2007-06-28 Thread Greg Meredith
Haskellians, 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

Re: [Haskell-cafe] let vs do?

2007-06-28 Thread Thomas Schilling
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

Re: [Haskell-cafe] let vs do?

2007-06-28 Thread Greg Meredith
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 [EMAIL PROTECTED] wrote: On 28 jun 2007, at 21.17, Greg Meredith wrote: Once

Re: [Haskell-cafe] let vs do?

2007-06-28 Thread Dave Bayer
On Jun 28, 2007, at 12:17 PM, Greg Meredith wrote: Haskellians, 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

Re: [Haskell-cafe] let vs do?

2007-06-28 Thread Thomas Schilling
On 28 jun 2007, at 22.02, Greg Meredith wrote: 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. Ok, sorry if my reply seemed harsh. You are of course right, that having