-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
There are notions of mapping, folding, and traversing available for type-aligned sequences:
class TAMappable t where
tmap :: (forall x y . c x y -> d x y) -> t c p q -> t d p q
class TAFoldable f where
tfoldMap :: Category d => (forall x y . c x y -> d x y) -> f c p q -> d p qEither of the following (I'm not sure which is better):
class (TAMappable t, TAFoldable t) => TATraversable t where
ttraverse :: IxApplicative m => (forall x y . c x y -> m y x (d x y)) -> t c p q -> m q p (t d p q)
class (TAMappable t, TAFoldable t) => TATraversable t where
ttraverse :: IxApplicative m => (forall x y . c x y -> m x y (d x y)) -> t c p q -> m p q (t d p q)The two options correspond to the traversals in each direction. If I'm not mistaken, they're related by IxBackwards (#2).
Metadata
Metadata
Assignees
Labels
No labels