module Auth.Biscuit.Utils
( maybeToRight
, rightToMaybe
) where
maybeToRight :: b -> Maybe a -> Either b a
maybeToRight :: forall b a. b -> Maybe a -> Either b a
maybeToRight b
b = forall b a. b -> (a -> b) -> Maybe a -> b
maybe (forall a b. a -> Either a b
Left b
b) forall a b. b -> Either a b
Right
rightToMaybe :: Either b a -> Maybe a
rightToMaybe :: forall b a. Either b a -> Maybe a
rightToMaybe = forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
either (forall a b. a -> b -> a
const forall a. Maybe a
Nothing) forall a. a -> Maybe a
Just