You can clone with
When playing with a bit of code I needed a combine function, which I think should be part of the adjunctions library.
combine :: Adjunction f u => u a -> f b -> (a, b)
combine ua = rightAdjunct (\b -> fmap (\a -> (a, b)) ua)
Nice, zapWith is even better. (I don't know about the newtype.)
But take your time, it was just a bit of toy code, and I don't think it adds anything useful to the enumerator/conduit/pipe discussion.
What about just a type synonym
type Zap f g = forall a b c. (a -> b -> c) -> f a -> g b -> c
zap :: Zap f g -> f (a -> b) -> g a -> b
zap z = z id
flipZap :: Zap f g -> Zap g f
flipZap z f a b = z (flip f) b a
composeZap :: Zap f g -> Zap h i -> Zap (Compose f h) (Compose g i)
composeZap u v f (Compose a) (Compose b) = u (v f) a b