ekmett / bifunctors

Haskell 98 bifunctors, bifoldables and bitraversables
Other
57 stars 42 forks source link

bisequence #59

Closed Icelandjack closed 6 years ago

Icelandjack commented 7 years ago

From here, I don't know if it requires unsafe

biSequence :: (Biapplicative p, T.Traversable t) => t (p a b) -> p (t a) (t b)
biSequence = bimap (fmap somethingCoerce) (fmap somethingCoerce)
             . unCollapse
             . T.sequenceA
             . fmap (Collapse . bimap Something Something)
RyanGlScott commented 7 years ago

At the very least, I'd like to see an implementation of this that doesn't use unsafeCoerce.

treeowl commented 6 years ago

I don't we should call this bisequence, because it's very different from bitraverse. Should we call it disequence, or would that evoke Profunctor too strongly?

treeowl commented 6 years ago

@Icelandjack, see #69.