erg/examples/quantified.er
2022-10-03 11:04:06 +09:00

14 lines
295 B
Python

id|T: Type|(x: T): T = x
assert id(1) == 1
assert id(True) == True
assert id("hello") == "hello"
const|T: Type, C: Type|(c: C): (T -> C) = (_: T,) -> c
print! const(1)(2)
assert const(True)(2) == True
print_to_str!|S <: Show|(s: S): Str =
print! s
s.to_str()
discard print_to_str!(1)