From 2ef36fefc877713c18a073b0792a6a11fb8d265d Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Tue, 17 Feb 2026 05:21:14 -0500 Subject: Charsheet --- fig-utils/src/Fig/Prelude.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fig-utils/src/Fig') diff --git a/fig-utils/src/Fig/Prelude.hs b/fig-utils/src/Fig/Prelude.hs index ef2d247..fbbd31c 100644 --- a/fig-utils/src/Fig/Prelude.hs +++ b/fig-utils/src/Fig/Prelude.hs @@ -45,6 +45,7 @@ module Fig.Prelude , tshow , headMay, atMay , throwLeft + , eitherToMaybe , log , (>>>) @@ -114,6 +115,10 @@ throwLeft :: (Exception e, MonadThrow m) => (b -> e) -> Either b a -> m a throwLeft f (Left x) = throwM $ f x throwLeft _ (Right x) = pure x +eitherToMaybe :: Either l r -> Maybe r +eitherToMaybe (Left _) = Nothing +eitherToMaybe (Right x) = Just x + (>>>) :: (a -> b) -> (b -> c) -> a -> c (>>>) = flip (.) -- cgit v1.2.3