summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-11-01 17:19:12 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-11-01 17:19:12 -0400
commit9a22207b565607db64f95dda5fdc1c9e56224ec9 (patch)
treefcd5c44e383db901b132519ee9a953101bcb7b04 /src
parent36a9df5f71b954949b92520c6e472548aa5ebfb1 (diff)
Fix some type-class detection
Diffstat (limited to 'src')
-rw-r--r--src/elab_env.sml1
-rw-r--r--src/elaborate.sml1
-rw-r--r--src/monoize.sml9
3 files changed, 11 insertions, 0 deletions
diff --git a/src/elab_env.sml b/src/elab_env.sml
index 2732de13..6b762abd 100644
--- a/src/elab_env.sml
+++ b/src/elab_env.sml
@@ -419,6 +419,7 @@ fun class_pair_in (c, _) =
(case (class_name_in f, class_key_in x) of
(SOME f, SOME x) => SOME (f, x)
| _ => NONE)
+ | CUnif (_, _, _, ref (SOME c)) => class_pair_in c
| _ => NONE
fun resolveClass (env : env) c =
diff --git a/src/elaborate.sml b/src/elaborate.sml
index 38c03f6e..b0f2d331 100644
--- a/src/elaborate.sml
+++ b/src/elaborate.sml
@@ -1398,6 +1398,7 @@ fun normClassConstraint envs (c, loc) =
in
((L'.CApp (f, x), loc), gs)
end
+ | L'.CUnif (_, _, _, ref (SOME c)) => normClassConstraint envs c
| _ => ((c, loc), [])
diff --git a/src/monoize.sml b/src/monoize.sml
index 79940842..0bdc1c70 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -844,6 +844,15 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
((L'.EFfi ("Basis", "boolToString"), loc), fm)
| L.EFfi ("Basis", "show_time") =>
((L'.EFfi ("Basis", "timeToString"), loc), fm)
+ | L.ECApp ((L.EFfi ("Basis", "mkShow"), _), t) =>
+ let
+ val t = monoType env t
+ val b = (L'.TFfi ("Basis", "string"), loc)
+ val dom = (L'.TFun (t, b), loc)
+ in
+ ((L'.EAbs ("f", dom, dom,
+ (L'.ERel 0, loc)), loc), fm)
+ end
| L.ECApp ((L.EFfi ("Basis", "read"), _), t) =>
let