
27 Sep
2012
27 Sep
'12
10:32 a.m.
On Thu, Sep 27, 2012 at 10:09 AM, Brent Yorgey
Isn't that still too strict? I would expect to see "abcdef" before the exception.
No, even foldr1 as hand-written on lists needs to look ahead. Normally it looks like: foldr1 f [x] = x foldr1 f (x:xs) = f x (foldr1 xs) but this is of course sugar for: foldr1 f (x:[]) = x foldr1 f (x:xs) = f x (foldr1 f xs) Where it's more obvious that it will hit the bottom before it can yield the "def". -- Dan