summaryrefslogtreecommitdiff
path: root/test/gtrait.myr
blob: 5131ccc6d02d79d6495291aeb8765e77f1b8d426 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std

trait comparable @a =
	cmp	: (a : @a, b : @a -> std.order)
;;

impl comparable @a::numeric =
	cmp = {a, b
		-> std.numcmp(a, b)
	}
;;

const main = {
	std.put("{}", cmp(1, 2))
}