let builtin_env =
let arrow_type pos t1 t2 =
TypApp (pos, TypVar (pos, TName "->"), [ t1; t2 ])
in
let tuple_type2 pos t1 t2 =
TypApp (pos, TypVar (pos, TName "*"), [ t1; t2 ])
in
let gen_tvar v =
TypVar (undefined_position, TName v)
in
[|
TName "pre", (false, NonAssoc, -1, KArrow (KStar, KStar), []);
TName "abs", (false, NonAssoc, -1, KStar, []);
TName "pi" , (false, EnclosedBy ("{", "}"), -1, KArrow (KEmptyRow, KStar), []);
TName "->" , (true, AssocRight, 0, KArrow (KStar, KArrow (KStar, KStar)), []);
TName "*" , (true, NonAssoc, 1, KArrow (KStar, KArrow (KStar, KStar)),
[ (DName "_Tuple", [ TName "a"; TName "b" ],
arrow_type undefined_position (gen_tvar "a")
(arrow_type undefined_position (gen_tvar "b")
(tuple_type2 undefined_position
(gen_tvar "a") (gen_tvar "b"))))
]);
TName "int" , (false, NonAssoc, 2, KStar, []);
TName "char", (false, NonAssoc, 2, KStar, []);
TName "unit", (false, NonAssoc, 3, KStar,
[ (DName "_Unit", [],
TypVar (undefined_position, TName "unit"))])
|]