[GHC] #13573: Add Foldable1 to base

GHC ghc-devs at haskell.org
Mon Feb 26 17:49:26 UTC 2018


#13573: Add Foldable1 to base
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #10365            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by chshersh):

 If this type class will be added to `base` library one day (which I
 personally really like to see) I would love to add that it would be good
 to have `fold1'` function with strict semantic (similar to `foldl'`).
 Otherwise `fold1 $ map Sum (1 :| [2 .. 10^8])` would take infinite amount
 of time and memory to calculate and there will be no better way to do
 this.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13573#comment:12>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list