proj :: (Functor f) =>  (f:*:f') (a,b) -> f a
proj (Pair x _) = fmap fst x

Yes I think that was what I needed. ;-) It seems I also need

fsplit :: (Functor f, Functor f') =>
   (f a, f' b) -> (f :*: f') (a,b)

for same    data (f:*:f') o = Pair (f o) (f' o)

Which takes (FA, F'B) into FxF' (A,B). I am confused by the fact of having two instances of F and somehow I need to map on both of them simultaneously.

Med vänliga hälsningar / Yours Sincerely,
Johan Glimming
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to