We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 984ba19 commit 3607e71Copy full SHA for 3607e71
hw-prelude.cabal
@@ -92,6 +92,7 @@ library
92
93
exposed-modules: HaskellWorks.Control.Monad
94
HaskellWorks.Data.String
95
+ HaskellWorks.Either
96
HaskellWorks.Error
97
HaskellWorks.Error.Types
98
HaskellWorks.Error.Types.GenericError
src/HaskellWorks/Either.hs
@@ -1,4 +1,10 @@
1
-module HaskellWorks.Data.Either
2
- ( eitherToMaybe
3
- , maybeToEither
+module HaskellWorks.Either
+ ( orElse
4
) where
+
5
+import Data.Either
6
+import Data.Function
7
8
+orElse :: Either e a -> Either e a -> Either e a
9
+orElse a b =
10
+ either (const b) Right a
0 commit comments