1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Simplify maybeBothOfThese around fromThese.

This commit is contained in:
Rob Rix 2016-04-04 15:38:56 -04:00
parent 25bae5d9e0
commit a33acf8bdf

View File

@ -22,7 +22,7 @@ bothOfThese (Join a) = Join . uncurry fromThese a
-- | Construct Both (Maybe) with These values, defaulting to Nothing.
maybeBothOfThese :: These a a -> Both (Maybe a)
maybeBothOfThese = bothOfThese (pure Nothing) . bimap Just Just
maybeBothOfThese = Join . fromThese Nothing Nothing . bimap Just Just
-- | Pairs either or both elements of These with the corresponding elements of Both.
-- |