theory2.bnf 666 Bytes
Newer Older
1 2 3 4
\begin{syntax}
  type-defn ::=                                      ; abstract type
    | "=" type                                       ; alias type
    | "=" "|"? type-case ("|" type-case)*            ; algebraic type
5
    | "=" "{" record-field (";" record-field)* "}"   ; record type
6 7
    | "<" "range" integer integer ">"                ; range type
    | "<" "float" integer integer ">"                ; float type
8 9 10 11 12 13 14 15 16 17 18
  \
  type-case ::= uident label* type-param*
  \
  record-field ::= lident label* ":" type
  \
  type-param ::= "'" lident   ;
   | lqualid                  ;
   | "(" lident+ ":" type ")" ;
   | "(" type ("," type)* ")" ;
   | "()"
\end{syntax}