
31 Oct
2006
31 Oct
'06
4:54 p.m.
Arie Peterson wrote: ] I'm not sure I'm getting your point, but this is just because in the ] second instance, the second parameter of BuildList is 'a -> r', so the ] specific type of 'build\'' is '[a] -> a -> (a -> r)' which is just '[a] -> ] a -> a -> r' (currying at work). I guess it just looks really strange to my eyes. For example, "foo" and "bar" are legal, but "baz" isn't. That's what I was thinking of the situation, but I guess the type classes iron out the differences.
foo :: Int -> Int -> Int -> Int foo 0 = (+)
bar :: Int -> Int -> Int -> Int bar 1 x = succ
baz :: Int -> Int -> Int -> Int baz 0 = (+) baz 1 x = succ
Greg Buchholz