mirror of
https://github.com/github/semantic.git
synced 2024-12-23 14:54:16 +03:00
Document Crosswalk.
This commit is contained in:
parent
283b906cef
commit
7dadd53445
@ -38,6 +38,9 @@ instance Align Maybe where
|
|||||||
| otherwise = Nothing
|
| otherwise = Nothing
|
||||||
|
|
||||||
|
|
||||||
|
-- | A functor which can be traversed through an `Align`able functor, inverting the nesting of one in the other.
|
||||||
|
-- |
|
||||||
|
-- | Analogous with `zip`, in that it can e.g. turn a tuple of lists into a list of tuples.
|
||||||
class Functor t => Crosswalk t where
|
class Functor t => Crosswalk t where
|
||||||
crosswalk :: Align f => (a -> f b) -> t a -> f (t b)
|
crosswalk :: Align f => (a -> f b) -> t a -> f (t b)
|
||||||
crosswalk f = sequenceL . fmap f
|
crosswalk f = sequenceL . fmap f
|
||||||
|
Loading…
Reference in New Issue
Block a user