| Version 7 (modified by benl, 3 years ago) |
|---|
Disciple vs Haskell
These are some syntactic differences that tend to trip up Haskell programmers when they first start with Disciple.
- 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
but not:
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 ($)
