diff src/ur/openidUser.urs @ 28:fcd3a977d77b

More type class instances for user type; allow choose to fail
author Adam Chlipala <adam@chlipala.net>
date Thu, 24 Feb 2011 17:29:05 -0500
parents ee97bc0e08fa
children 1be573ac8e2b
line wrap: on
line diff
--- a/src/ur/openidUser.urs	Sun Jan 23 17:40:42 2011 -0500
+++ b/src/ur/openidUser.urs	Thu Feb 24 17:29:05 2011 -0500
@@ -7,6 +7,8 @@
  * Module author: Adam Chlipala
  *)
 
+datatype choose_result a = Success of a | Failure of string
+
 (* Instantiate this functor to create your customized authentication scheme. *)
 functor Make(M: sig
                  con cols :: {Type}
@@ -35,7 +37,7 @@
                  (* Functionalize current state. *)
 
                  val choose : sql_table ([Id = string] ++ cols) [Pkey = [Id]]
-                              -> creationData -> transaction $cols
+                              -> creationData -> transaction (choose_result $cols)
                  (* Use functionalized state to choose initial column values,
                   * given a handle to the users table. *)
 
@@ -67,7 +69,9 @@
              end) : sig
 
     type user
+    val eq_user : eq user
     val show_user : show user
+    val read_user : read user
     val inj_user : sql_injectable_prim user
     (* The abstract type of user IDs.  It's really [string], but this is only
      * exposed via some standard type class instances. *)