16 lines
628 B
JavaScript
16 lines
628 B
JavaScript
import { getDefaultTypeParser }from "../lib/parser/type_parser.js";
|
||
import { prettyGenT, prettyT } from "../lib/util/pretty.js";
|
||
|
||
const parse = getDefaultTypeParser();
|
||
|
||
console.log(prettyT(parse("Int"))); // Int
|
||
|
||
console.log(prettyT(parse("Int * Bool"))); // (Int ⨯ Bool)
|
||
|
||
console.log(prettyT(parse("(((((((Int)))) => ((Bool)))))"))); // (Int => Bool)
|
||
|
||
console.log(prettyT(parse("#0((Int * #0) + Unit)"))) // #0((Int ⨯ #0) + Unit)
|
||
|
||
console.log(prettyGenT(parse("∀a: #0((a * #0) + Unit"))); // ∀a: #0((a ⨯ #0) + Unit)
|
||
|
||
console.log(prettyGenT(parse("∀a,b,c,d: (a*b) + (c*d)"))); // ∀a,b,c,d: ((a ⨯ b) + (c ⨯ d))
|