Moved transfer libraries to transfer/lib

This commit is contained in:
bringert
2005-11-30 16:00:06 +00:00
parent 47ad17e78d
commit 5ffef88edc
7 changed files with 40 additions and 9 deletions

11
transfer/lib/maybe.tr Normal file
View File

@@ -0,0 +1,11 @@
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