mirror of
https://github.com/github/semantic.git
synced 2024-12-23 23:11:50 +03:00
🔥 the Align instance over Maybe.
This commit is contained in:
parent
a22f713a97
commit
fb0f8171d9
@ -30,13 +30,6 @@ instance Align [] where
|
||||
| otherwise = zipWith These as bs
|
||||
where (la, lb) = (length as, length bs)
|
||||
|
||||
instance Align Maybe where
|
||||
nil = Nothing
|
||||
a `align` b | Just a <- a, Just b <- b = Just (These a b)
|
||||
| Just a <- a = Just (This a)
|
||||
| Just b <- b = Just (That b)
|
||||
| otherwise = Nothing
|
||||
|
||||
|
||||
-- | A functor which can be traversed through an `Align`able functor, inverting the nesting of one in the other, given some default value.
|
||||
-- |
|
||||
|
Loading…
Reference in New Issue
Block a user