]> Git — Sourcephile - gargantext.git/blob - src/Gargantext/Utils/Tuple.hs
Merge remote-tracking branch 'origin/adinapoli/issue-188' into dev
[gargantext.git] / src / Gargantext / Utils / Tuple.hs
1 module Gargantext.Utils.Tuple where
2
3 import Protolude
4
5
6
7 uncurryMaybe :: (Maybe a, Maybe b) -> Maybe (a, b)
8 uncurryMaybe (Nothing, _) = Nothing
9 uncurryMaybe (_, Nothing) = Nothing
10 uncurryMaybe (Just a, Just b) = Just (a, b)
11
12 uncurryMaybeSecond :: (a, Maybe b) -> Maybe (a, b)
13 uncurryMaybeSecond (_, Nothing) = Nothing
14 uncurryMaybeSecond (a, Just b) = Just (a, b)