[GHC] #13026: RFC functions for sums and products

GHC ghc-devs at haskell.org
Tue Jan 24 02:40:43 UTC 2017


#13026: RFC functions for sums and products
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  libraries/base    |              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:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 {{{#!hs
 e1 :: (f a -> b) -> (g a -> b) -> (f :+: g) a -> b
 e1 f _ (L1 l) = f l
 e1 _ f (R1 r) = f r

 fst1 :: (f :*: g) a -> f a
 fst1 (l :*: _) = l
 snd1 :: (f :*: g) a -> g a
 snd1 (_ :*: r) = r
 }}}

 are defined in [https://hackage.haskell.org/package/one-liner-0.7/docs/src
 /Generics-OneLiner-Internal.html one-liner]

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


More information about the ghc-tickets mailing list