summaryrefslogtreecommitdiff
path: root/transfer/lib/maybe.tr
diff options
context:
space:
mode:
Diffstat (limited to 'transfer/lib/maybe.tr')
-rw-r--r--transfer/lib/maybe.tr24
1 files changed, 0 insertions, 24 deletions
diff --git a/transfer/lib/maybe.tr b/transfer/lib/maybe.tr
deleted file mode 100644
index 2b7beee9a..000000000
--- a/transfer/lib/maybe.tr
+++ /dev/null
@@ -1,24 +0,0 @@
-import prelude
-
-data Maybe : Type -> Type where
- Nothing : (A : Type) -> Maybe A
- Just : (A : Type) -> A -> Maybe A
-
-fromMaybe : (A : Type) -> A -> Maybe A -> A
-fromMaybe _ x Nothing = x
-fromMaybe _ _ (Just x) = x
-
-maybe : (A : Type) -> (B : Type) -> B -> (A -> B) -> Maybe A -> A
-maybe _ _ x _ Nothing = x
-maybe _ _ _ f (Just x) = f x
-
--- Instances:
-
-monad_Maybe : Monad Maybe
-monad_Maybe =
- rec return = Just
- bind = \A -> \B -> \m -> \k ->
- case m of
- Nothing _ -> Nothing B
- Just _ x -> k x
-