aboutsummaryrefslogtreecommitdiff
path: root/src/executable/haskell/Utils/Either.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/executable/haskell/Utils/Either.hs')
-rw-r--r--src/executable/haskell/Utils/Either.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/executable/haskell/Utils/Either.hs b/src/executable/haskell/Utils/Either.hs
new file mode 100644
index 0000000..5d62dcc
--- /dev/null
+++ b/src/executable/haskell/Utils/Either.hs
@@ -0,0 +1,7 @@
+module Utils.Either
+ ( mapLeft
+ ) where
+
+mapLeft :: (a -> c) -> Either a b -> Either c b
+mapLeft f (Left l) = Left (f l)
+mapLeft _ (Right r) = (Right r)