3 ms·
`zero` doesn't act on integers, it acts on other functions. The second argument to `zero` is a placeholder. The intuition is that `zero s` is "apply the functi
by gohrt 12y ago
`zero` doesn't act on integers, it acts on other functions.
The second argument to `zero` is a placeholder. The intuition is that `zero s` is "apply the function `s` zero times". What do you get if you apply the function `s` zero times to an argument `z`? You get `z`.
There's a hint later down in the article about type-checking.
- tieTYT 12y agoTechnically, it can act on integers: Prelude> let zero s z = z Prelude> :t zero zero :: t -> t1 -> t1 Prelude> t and t1 can be integers. Really the point of my comment is that the article could be written much better (assuming I'm the intended demographic).