[GHC] #13573: Add Foldable1 to base

GHC ghc-devs at haskell.org
Wed Apr 26 10:12:24 UTC 2017


#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 Iceland_jack):

 Examples from [https://hackage.haskell.org/package/algebra-4.3/docs
 /Numeric-Algebra-Class.html
 alge][https://hackage.haskell.org/package/algebra-4.3/docs/Numeric-
 Additive-Class.html bra] package

 {{{#!hs
 class Additive r where
   (+)      :: r -> r -> r
   sumWith1 :: Foldable1 f => (a -> r) -> f a -> r

 class Multiplicative r where
   (*)          :: r -> r -> r
   productWith1 :: Foldable1 f => (a -> r) -> f a -> r
 }}}

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


More information about the ghc-tickets mailing list