News for hackers. Stuff that matters.
Re:The New Haskell.org by arianvanp on Sunday February 15, 2015 @05:47AM (#9052299)
Two problems:

1. multi-line expressions aren't supported by the REPL.

2. You will need to use `let x = ..` syntax in the REPL (This is because the REPL are just so called IO-actions and the `let` syntax defines variables within its lexical scope)

You could try this:

    > let sieve (p:xs) =  p : sieve [x | x <- xs, x `mod` p /= 0]
    > let primes = sieve [2..]
    > primes !! 3
    > primes !! 4
Nice part abou this code is eventhough you express calculating ALL primes. It will only calculate upto the 3rd and the 4th prime due to lazy evaluation. This is one of the great strengths of haskell.
Re:The New Haskell.org by pasta-driven on Sunday February 15, 2015 @07:14AM (#9052413)
This online REPL does not support `let` either.

`let x = 4` is not an expression there.

Re:The New Haskell.org by tomjakubowski on Sunday February 15, 2015 @08:04AM (#9052498)
At the online REPL, you have to write something like:

    let primes = sieve [2..] where sieve (p:xs) = p : sieve [x| x <- xs, x `mod` p /= 0] in primes
Which is rather annoying.
Re:The New Haskell.org by yawaramin on Sunday February 15, 2015 @02:49PM (#9053796)
Not only that, but you have to do something like

    let primes = ... in take 5 primes
... if you want the computation to complete without hanging the browser. It would be nice if the REPL supported multi-line expressions.