Changes between Version 7 and Version 8 of Ticket #15131, comment 2


Ignore:
Timestamp:
May 10, 2018 9:38:13 AM (17 months ago)
Author:
YitzGale
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15131, comment 2

    v7 v8  
    1717    foldr f z ~(a :| as) = f a (List.foldr f z as)
    1818    foldr1 f ~(a :| as) = List.foldr f a as
    19     foldMap f ~(a :| as) = List.foldr (mappend . f) (f a) as
    2019    length (_ :| as) = List.length as + 1
    2120    maximum (a :| as) = max a (List.maximum as)
     
    2928EDIT: Made a few edits to the above code. Among other things: Leave {{{fold}}} at default because List does. But the default for {{{foldMap}}} is silly for {{{NonEmpty}}}.
    3029
    31 EDIT2: removed the lazy patterns from the {{{foldl*}}} methods as mentioned on Phab.
     30EDIT2: removed the lazy patterns from the {{{foldl*}}} methods as mentioned on Phab.
     31
     32EDIT3: Never mind, my {{{foldMap}}} was wrong. I don't see any way to do better than default after all for {{{foldMap}}}.