[Haskell-cafe] map over Bijections

Erik Hesselink hesselink at gmail.com
Mon Aug 27 16:37:26 CEST 2012


If you remove the second argument (which you don't use), you have the
function `liftBij` that is in fclabels.

Erik

On Mon, Aug 27, 2012 at 3:55 PM, Sergey Mironov <ierton at gmail.com> wrote:
> Hi. I need map equivalent for Bijection type which is defined in fclabels:
>
> data Bijection (~>) a b = Bij { fw :: a ~> b, bw :: b ~> a }
>
> instance Category (~>) => Category (Bijection (~>)) where ...
>
> I can define this function as follows:
> mapBij :: Bijection (->) a c -> Bijection (->) [a] [b] -> Bijection (->) [a] [c]
> mapBij b1 b = (map (fw b1)) `Bij` (map (bw b1))
>
> but do I really need to do it explicitly? Can I obtain same result
> using some Category combinators or other common stuff?
>
> Sergey
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe



More information about the Haskell-Cafe mailing list