changeset 29:7530b2b54353

Update for Ur/Web's new type class handling
author Adam Chlipala <adam@chlipala.net>
date Sun, 29 Jul 2012 12:27:36 -0400
parents f55f66c6fdee
children 4e673b535434
files json.ur variant.ur
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/json.ur	Thu Jul 26 16:48:37 2012 -0400
+++ b/json.ur	Sun Jul 29 12:27:36 2012 -0400
@@ -1,5 +1,5 @@
-class json a = {ToJson : a -> string,
-                FromJson : string -> a * string}
+con json a = {ToJson : a -> string,
+              FromJson : string -> a * string}
 
 fun mkJson [a] (x : {ToJson : a -> string,
                      FromJson : string -> a * string}) = x
--- a/variant.ur	Thu Jul 26 16:48:37 2012 -0400
+++ b/variant.ur	Sun Jul 29 12:27:36 2012 -0400
@@ -137,7 +137,7 @@
               [s::_] [[nm = v] ++ r ~ s] => k [[nm = v] ++ s] ++ {nm = make [nm]})
           (fn [s::_] [[] ~ s] => {}) fl [[]] !
 
-class type_case = fn ts t a => (a -> variant ts) -> a -> t
+con type_case ts t a = (a -> variant ts) -> a -> t
 
 fun declareCase [ts] [t] [a] (f : (a -> variant ts) -> a -> t) : type_case ts t a = f
 fun typeCase [ts] [t] (v : variant ts) (dstrs : $(map (type_case ts t) ts)) (fl : folder ts) : t