diff lib/basis.urs @ 564:803b2f3bb86b

Monad type class seems to be working
author Adam Chlipala <adamc@hcoop.net>
date Fri, 19 Dec 2008 10:27:58 -0500
parents 5d494183ca89
children 74800be65591
line wrap: on
line diff
--- a/lib/basis.urs	Fri Dec 19 10:03:31 2008 -0500
+++ b/lib/basis.urs	Fri Dec 19 10:27:58 2008 -0500
@@ -69,15 +69,22 @@
 val read_time : read time
 
 
-(** * Transactions *)
+(** * Monads *)
+
+class monad :: Type -> Type
+val return : m ::: (Type -> Type) -> t ::: Type
+             -> monad m
+             -> t -> m t
+val bind : m ::: (Type -> Type) -> t1 ::: Type -> t2 ::: Type
+           -> monad m
+           -> m t1 -> (t1 -> m t2)
+           -> m t2
+
+(** ** Transactions *)
 
 con transaction :: Type -> Type
+val transaction_monad : monad transaction
 
-val return : t ::: Type
-             -> t -> transaction t
-val bind : t1 ::: Type -> t2 ::: Type
-           -> transaction t1 -> (t1 -> transaction t2)
-           -> transaction t2
 
 
 (** HTTP operations *)