
24 Dec
2016
24 Dec
'16
5:06 a.m.
Baldur Blöndal
Let's see if any of these are useful (a lot more at https://ghc.haskell.org/trac/ghc/ticket/13026)
(||||) :: (f a -> b) -> (g a -> b) -> ((Sum f g) a -> b) f |||| g = \case InL fa -> f fa InR ga -> g ga
(&&&&) :: (a -> f b) -> (a -> g b) -> (a -> (Product f g) b) (f &&&& g) a = f a `Pair` g a
I couldn't think of any for Data.Functor.Compose, names are up for bikeshedding
I don’t have any particular preference for names, but I’d say that any name consisting of more than three consecutive identical symbols is going to be too hard to read (particularly if the symbol is “|”). There’s a whole unicode alphabet out there. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk