aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/reduce.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2016-02-07 19:59:10 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2016-02-07 19:59:10 -0500
commit5579b84a97cb942fdfd4c4898793f9de95bc03d1 (patch)
tree2fd60da2fe681fa69d712efdeb36b720c72b9820 /src/reduce.sml
parenta777dd13f4075418ec883f4eb42e5de1739d50d1 (diff)
Merge PVar and PWild, to get more reasonable type-class resolution
Diffstat (limited to 'src/reduce.sml')
-rw-r--r--src/reduce.sml9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/reduce.sml b/src/reduce.sml
index 0762a4a1..08040ad3 100644
--- a/src/reduce.sml
+++ b/src/reduce.sml
@@ -148,8 +148,7 @@ fun match (env, p : pat, e : exp) =
fun match (env, p, e) =
case (#1 p, #1 e) of
- (PWild, _) => Yes env
- | (PVar (x, t), _) => Yes (KnownE (multiLiftExpInExp (length env - baseline) e) :: env)
+ (PVar (x, t), _) => Yes (KnownE (multiLiftExpInExp (length env - baseline) e) :: env)
| (PPrim p, EPrim p') =>
if Prim.equal (p, p') then
@@ -425,8 +424,7 @@ fun kindConAndExp (namedC, namedE) =
fun patBinds (p, _) =
case p of
- PWild => 0
- | PVar _ => 1
+ PVar _ => 1
| PPrim _ => 0
| PCon (_, _, _, NONE) => 0
| PCon (_, _, _, SOME p) => patBinds p
@@ -763,8 +761,7 @@ fun kindConAndExp (namedC, namedE) =
let
fun pat (all as (p, loc)) =
case p of
- PWild => all
- | PVar (x, t) => (PVar (x, con env t), loc)
+ PVar (x, t) => (PVar (x, con env t), loc)
| PPrim _ => all
| PCon (dk, pc, cs, po) =>
(PCon (dk, patCon pc, map (con env) cs, Option.map pat po), loc)