
27 Sep
2012
27 Sep
'12
10:29 a.m.
On Thu, Sep 27, 2012 at 03:09:07PM +0100, Brent Yorgey wrote:
On Thu, Sep 27, 2012 at 12:21:32AM +0200, Henning Thielemann wrote:
*Data.NonEmpty> foldr2 (P.++) $ "abc" : "def" : P.undefined "*** Exception: Prelude.undefined
*Data.NonEmpty> foldr3 (P.++) $ "abc" : "def" : P.undefined "abc*** Exception: Prelude.undefined
Isn't that still too strict? I would expect to see "abcdef" before the exception.
No, foldr3 matches what Data.List.foldr1 does: Prelude> foldr1 (++) $ "abc" : "def" : undefined "abc*** Exception: Prelude.undefined It can't decide whether "def":undefined matches [x].