summaryrefslogtreecommitdiff
path: root/test/traitimpl.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-02-20 22:47:18 -0500
committerOri Bernstein <ori@eigenstate.org>2014-02-20 22:47:18 -0500
commit1efff8a755b22b20bec7c671c25a63825cfd90f1 (patch)
treeecc10904318b67384a2c005fffe02c0dad34b663 /test/traitimpl.myr
parentf666a9b2a62c4f8588c6add2bcc2071f95ef357c (diff)
downloadmc-1efff8a755b22b20bec7c671c25a63825cfd90f1.tar.gz
Traits specialize!
Diffstat (limited to 'test/traitimpl.myr')
-rw-r--r--test/traitimpl.myr20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/traitimpl.myr b/test/traitimpl.myr
new file mode 100644
index 0000000..5d32d05
--- /dev/null
+++ b/test/traitimpl.myr
@@ -0,0 +1,20 @@
+use std
+
+trait frobable @a =
+ frob : (val : @a -> @a)
+;;
+
+impl frobable int =
+ frob = {val
+ -> val * 2
+ }
+;;
+
+generic foo = {x : @a::frobable
+ -> frob(x)
+}
+
+const main = {
+ std.exit(foo(12))
+}
+