|Version 5 (modified by benl, 4 years ago)|
Disciple vs Haskell
These are some syntactic differences between Disciple and Haskell that tend to trip up Haskell programmers.
- Disciple uses strict / call-by-value as the default evaluation order. This implies that bindings in let and where expressions must be written in dependency order. For example, you can write:
fun :: Int -> Int fun x = x + z where y = g x z = 3 + y
fun :: Int -> Int fun x = x + z where z = 3 + y y = g x
This doesn't work because the bindings for y and z are in the "wrong" order.
For let and where expressions, all the bindings are evaluated in-order, before moving to the body.
- We use (.) for projection instead of function composition. If you want to compose two functions then use ($)