1
1
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:
Rob Rix 2016-03-15 08:23:48 -04:00
parent a22f713a97
commit fb0f8171d9

View File

@ -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.
-- |