If functions foo, bar, baz are pure, then:
fun = do
put []
x <- get >>= State $ foo 1
y <- get >>= State $ bar x
z <- get >>= State $ baz x y
--
View this message in context:
http://haskell.1045720.n5.nabble.com
s <- get
baz x y s
--
View this message in context:
http://haskell.1045720.n5.nabble.com/Proposal-Non-recursive-let-tp5732690p5732747.html
Sent from the Haskell - Haskell-prime mailing list archive at Nabble.com.
___
Haskell-pri
in context:
http://haskell.1045720.n5.nabble.com/Proposal-Non-recursive-let-tp5732690p5732747.html
Sent from the Haskell - Haskell-prime mailing list archive at Nabble.com.
___
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.or
Maybe you are right on this, and I just misunderstood let-guards.
But with a non-recursive let, I would get a scope error instead of
non-termination if I write
let Just x | x > 0 = e ...
which I definitely prefer.
So, consider this aspect dropped from my proposal of non-recursive lets.
On
On 10.07.2013 10:00, Jon Fairbairn wrote:
Andreas Abel
writes:
Proposal: add a non-recursive let to the Haskell language. In
let' p = e in e'
do { ... let' p = e ... }
the variables of pattern p are then *not* in scope in e.
Reasons for adding a non-recursive let:
1. recursive-let i
[reposting to Haskell-prime]
Jon Fairbairn wrote:
> It just changes forgetting to use different variable names because of
> recursion (which is currently uniform throughout the language) to
> forgetting to use non recursive let instead of let.
Let me bring to the record the message I just wrote
Andreas Abel
writes:
> Proposal: add a non-recursive let to the Haskell language. In
>
> let' p = e in e'
> do { ... let' p = e ... }
>
> the variables of pattern p are then *not* in scope in e.
>
> Reasons for adding a non-recursive let:
>
> 1. recursive-let is the source for many non-termi
On Wed, Jul 10, 2013 at 3:08 AM, Andreas Abel wrote:
> Another instance (cut-down) are let-guards like
>
> let Just x | x > 0 = e in x
>
> The "x > 0" is understood as an assertion here, documenting an invariant.
> However, Haskell reads this as
>
> let Just x = case () of { () | x > 0 -> e }
Proposal: add a non-recursive let to the Haskell language. In
let' p = e in e'
do { ... let' p = e ... }
the variables of pattern p are then *not* in scope in e.
Reasons for adding a non-recursive let:
1. recursive-let is the source for many non-termination bugs.
An instance of such a bu