diff options
| author | LLLL Colonq <llll@colonq> | 2026-02-17 05:21:14 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2026-02-17 05:21:14 -0500 |
| commit | 2ef36fefc877713c18a073b0792a6a11fb8d265d (patch) | |
| tree | 6e887a9b7913c3dc5d032f9b913775df07cae68f /fig-utils | |
| parent | ff02141235d1dbec3492c5a7b49631fe440c4806 (diff) | |
Charsheet
Diffstat (limited to 'fig-utils')
| -rw-r--r-- | fig-utils/src/Fig/Prelude.hs | 5 |
1 files changed, 5 insertions, 0 deletions
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 (.) |
