summaryrefslogtreecommitdiff
path: root/src/urweb.grm
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-10-10 13:07:38 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2010-10-10 13:07:38 -0400
commitbfeac162a328dba937a28e747e4fc4006fac500c (patch)
tree1d0f355dec824a81d80e9e838e0cae8845f8e179 /src/urweb.grm
parent81934ea4c2cf2260b6000e9be4d13e328204929a (diff)
Flex kinds for type-level tuples; ::_ notation
Diffstat (limited to 'src/urweb.grm')
-rw-r--r--src/urweb.grm27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/urweb.grm b/src/urweb.grm
index dfc22112..0c85ad7f 100644
--- a/src/urweb.grm
+++ b/src/urweb.grm
@@ -212,7 +212,7 @@ fun tnamesOf (e, _) =
| STRING of string | INT of Int64.int | FLOAT of Real64.real | CHAR of char
| SYMBOL of string | CSYMBOL of string
| LPAREN | RPAREN | LBRACK | RBRACK | LBRACE | RBRACE
- | EQ | COMMA | COLON | DCOLON | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR
+ | EQ | COMMA | COLON | DCOLON | DCOLONWILD | TCOLON | DOT | HASH | UNDER | UNDERUNDER | BAR
| PLUS | MINUS | DIVIDE | DOTDOTDOT | MOD | AT
| CON | LTYPE | VAL | REC | AND | FUN | MAP | UNIT | KUNIT | CLASS
| DATATYPE | OF
@@ -510,6 +510,7 @@ dtypes : dtype ([dtype])
kopt : (NONE)
| DCOLON kind (SOME kind)
+ | DCOLONWILD (SOME (KWild, s (DCOLONWILDleft, DCOLONWILDright)))
dargs : ([])
| SYMBOL dargs (SYMBOL :: dargs)
@@ -853,6 +854,22 @@ carg : SYMBOL DCOLON kind (fn (c, k) =>
((CAbs ("_", SOME kind, c), loc),
(KArrow (kind, k), loc))
end)
+ | SYMBOL DCOLONWILD (fn (c, k) =>
+ let
+ val loc = s (SYMBOLleft, DCOLONWILDright)
+ val kind = (KWild, loc)
+ in
+ ((CAbs (SYMBOL, NONE, c), loc),
+ (KArrow (kind, k), loc))
+ end)
+ | UNDER DCOLONWILD (fn (c, k) =>
+ let
+ val loc = s (UNDERleft, DCOLONWILDright)
+ val kind = (KWild, loc)
+ in
+ ((CAbs ("_", NONE, c), loc),
+ (KArrow (kind, k), loc))
+ end)
| cargp (cargp)
cargp : SYMBOL (fn (c, k) =>
@@ -1079,6 +1096,14 @@ earga : LBRACK SYMBOL RBRACK (fn (e, t) =>
((ECAbs (Implicit, SYMBOL, kind, e), loc),
(TCFun (Implicit, SYMBOL, kind, t), loc))
end)
+ | LBRACK SYMBOL DCOLONWILD RBRACK (fn (e, t) =>
+ let
+ val loc = s (LBRACKleft, RBRACKright)
+ val kind = (KWild, loc)
+ in
+ ((ECAbs (Explicit, SYMBOL, kind, e), loc),
+ (TCFun (Explicit, SYMBOL, kind, t), loc))
+ end)
| LBRACK SYMBOL kcolon kind RBRACK(fn (e, t) =>
let
val loc = s (LBRACKleft, RBRACKright)