# HG changeset patch # User Ziv Scully # Date 1446348942 14400 # Node ID b49d22a4eda8786fd85160ce350d7db86f8e60b7 # Parent 85f91c7452b01996b3ac18dda7d33a49816c2de1# Parent d87d72b6e2994f777389d693e201d266bffb9ad1 Merge. diff -r 85f91c7452b0 -r b49d22a4eda8 lib/ur/monad.ur --- a/lib/ur/monad.ur Wed Oct 21 09:18:36 2015 -0400 +++ b/lib/ur/monad.ur Sat Oct 31 23:35:42 2015 -0400 @@ -81,6 +81,15 @@ return (acc ++ {nm = v'})) {} +fun mapR3 [K] [m] (_ : monad m) [tf1 :: K -> Type] [tf2 :: K -> Type] [tf3 :: K -> Type] [tr :: K -> Type] + (f : nm :: Name -> t :: K -> tf1 t -> tf2 t -> tf3 t -> m (tr t)) = + @@foldR3 [m] _ [tf1] [tf2] [tf3] [fn r => $(map tr r)] + (fn [nm :: Name] [t :: K] [rest :: {K}] [[nm] ~ rest] (v1 : tf1 t) (v2 : tf2 t) (v3 : tf3 t) + (acc : $(map tr rest)) => + v' <- f [nm] [t] v1 v2 v3; + return (acc ++ {nm = v'})) + {} + fun foldMapR [K] [m] (_ : monad m) [tf :: K -> Type] [tf' :: K -> Type] [tr :: {K} -> Type] (f : nm :: Name -> t :: K -> rest :: {K} -> [[nm] ~ rest] => diff -r 85f91c7452b0 -r b49d22a4eda8 lib/ur/monad.urs --- a/lib/ur/monad.urs Wed Oct 21 09:18:36 2015 -0400 +++ b/lib/ur/monad.urs Sat Oct 31 23:35:42 2015 -0400 @@ -58,6 +58,12 @@ -> (nm :: Name -> t :: K -> tf1 t -> tf2 t -> m (tr t)) -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> m ($(map tr r)) +val mapR3 : K --> m ::: (Type -> Type) -> monad m + -> tf1 :: (K -> Type) -> tf2 :: (K -> Type) -> tf3 :: (K -> Type) + -> tr :: (K -> Type) + -> (nm :: Name -> t :: K -> tf1 t -> tf2 t -> tf3 t -> m (tr t)) + -> r ::: {K} -> folder r -> $(map tf1 r) -> $(map tf2 r) -> $(map tf3 r) -> m ($(map tr r)) + val foldMapR : K --> m ::: (Type -> Type) -> monad m -> tf :: (K -> Type) -> tf' :: (K -> Type) diff -r 85f91c7452b0 -r b49d22a4eda8 src/c/urweb.c --- a/src/c/urweb.c Wed Oct 21 09:18:36 2015 -0400 +++ b/src/c/urweb.c Sat Oct 31 23:35:42 2015 -0400 @@ -818,9 +818,6 @@ ctx->db = NULL; } ctx->app->db_init(ctx); - - if (!ctx->db) - uw_error(ctx, FATAL, "Error reopening database connection"); } void uw_try_reconnecting_and_restarting(uw_context ctx) { diff -r 85f91c7452b0 -r b49d22a4eda8 src/elaborate.sml --- a/src/elaborate.sml Wed Oct 21 09:18:36 2015 -0400 +++ b/src/elaborate.sml Sat Oct 31 23:35:42 2015 -0400 @@ -783,7 +783,8 @@ val sum = case c of - (L'.CRecord (_, xcs), _) => {fields = xcs, unifs = [], others = []} + (L'.CRecord (_, xcs), _) => {fields = map (fn (x, c) => (hnormCon env x, hnormCon env c)) xcs, + unifs = [], others = []} | (L'.CConcat (c1, c2), _) => let val s1 = recordSummary env c1