summaryrefslogtreecommitdiff
path: root/fp1/week2/camil/VectorOverloading.dcl
diff options
context:
space:
mode:
authorMart Lubbers2015-04-16 21:22:20 +0200
committerMart Lubbers2015-04-16 21:22:20 +0200
commit6f604b19d3f5966e5c1d7c4fdf3703bd6ff0861c (patch)
tree96d580507249f7f58368476d9113007d4afcd748 /fp1/week2/camil/VectorOverloading.dcl
parentAdded student numbers (diff)
update to fp2 yay, public and licence
Diffstat (limited to 'fp1/week2/camil/VectorOverloading.dcl')
-rw-r--r--fp1/week2/camil/VectorOverloading.dcl14
1 files changed, 14 insertions, 0 deletions
diff --git a/fp1/week2/camil/VectorOverloading.dcl b/fp1/week2/camil/VectorOverloading.dcl
new file mode 100644
index 0000000..76f8520
--- /dev/null
+++ b/fp1/week2/camil/VectorOverloading.dcl
@@ -0,0 +1,14 @@
+definition module VectorOverloading
+
+import StdEnv
+
+:: Vector2 a = {x0 :: a, x1 :: a}
+
+instance == (Vector2 a) | == a
+instance zero (Vector2 a) | zero a
+instance one (Vector2 a) | one a
+instance ~ (Vector2 a) | ~ a
+instance + (Vector2 a) | + a
+instance - (Vector2 a) | - a
+instance * (Vector2 a) | * a
+instance / (Vector2 a) | / a