Data.Functor.{Product,Sum} functions

Baldur Blöndal baldurpet at gmail.com
Tue Dec 27 05:08:54 UTC 2016


I updated the proposal with (again more information in
https://ghc.haskell.org/trac/ghc/ticket/13026#comment:5)

runSum :: Sum f g a -> Either (f a) (g a)runSum = Left |||| Right
runProduct :: Product f g a -> (f a, g a)runProduct (Pair fa ga) = (fa, ga)

I found one for ‘Data.Functor.Compose’

o :: Functor m => (b -> n c) -> (a -> m b) -> (a -> Compose m n c)o f
g = Compose . fmap f . g
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20161227/20bcb5f5/attachment.html>


More information about the Libraries mailing list