
14 Jun
2008
14 Jun
'08
12:23 p.m.
On Jun 14, 2008, at 6:14 PM, odtaa48 wrote:
hello could someone explain the following differing results const id 0 5 -> 5 -- ie. 'takes' the 'last' one const (id 0) 5 -> 0 -- ie. 'takes' the 'first' one
Thanks
You can easily see what is happening by rewriting the equations step by step. Remember that the const function is (\x y -> x) and the id function is (\x -> x). Example 1: const id 0 5 == (const id 0) 5 == id 5 == 5 Example 2: const (id 0) 5 == const 0 5 == 0 So, in both cases const takes the first. -- Sebastiaan.