diff options
Diffstat (limited to 'src/elaborate.sml')
-rw-r--r-- | src/elaborate.sml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/elaborate.sml b/src/elaborate.sml index dcae4650..3346fc37 100644 --- a/src/elaborate.sml +++ b/src/elaborate.sml @@ -583,6 +583,25 @@ | L'.CProj (c, n) => (case hnormKind (kindof env c) of (L'.KTuple ks, _) => List.nth (ks, n - 1) + | (L'.KUnif (_, _, r), _) => + let + val ku = kunif loc + val k = (L'.KTupleUnif (loc, [(n, ku)], ref NONE), loc) + in + r := SOME k; + k + end + | (L'.KTupleUnif (_, nks, r), _) => + (case ListUtil.search (fn (n', k) => if n' = n then SOME k else NONE) nks of + SOME k => k + | NONE => + let + val ku = kunif loc + val k = (L'.KTupleUnif (loc, ((n, ku) :: nks), ref NONE), loc) + in + r := SOME k; + k + end) | k => raise CUnify' (CKindof (k, c, "tuple"))) | L'.CError => kerror |