diff options
author | Mart Lubbers | 2015-02-06 08:39:37 +0100 |
---|---|---|
committer | Mart Lubbers | 2015-02-06 08:39:37 +0100 |
commit | 379b6353396ca2401241d714733d570629835ffe (patch) | |
tree | 26652c854a79c627b5f50bc8ac26f9b84f8e196d /files/practicum/LijstOverloading.icl | |
parent | Merge branch 'master' of https://github.com/dopefishh/fp1 (diff) |
added practicum files, updated gitignore
Diffstat (limited to 'files/practicum/LijstOverloading.icl')
-rw-r--r-- | files/practicum/LijstOverloading.icl | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/files/practicum/LijstOverloading.icl b/files/practicum/LijstOverloading.icl new file mode 100644 index 0000000..5d40186 --- /dev/null +++ b/files/practicum/LijstOverloading.icl @@ -0,0 +1,20 @@ +implementation module LijstOverloading
+
+import StdEnv, LijstGenerator
+
+instance zero [a] | zero a where
+instance one [a] | one a where
+instance ~ [a] | ~ a where
+instance + [a] | + a where
+instance - [a] | - a where
+instance * [a] | * a where
+instance / [a] | / a where
+
+Start = (test [1,2,3], test [1.0,2.0,3.0])
+
+test a = ( zero + a == a && a == a + zero
+ , a - zero == a && a == ~ (zero - a)
+ , one * a == a && a == a * one
+ , a / one == a
+ , ~ (~ a) == a
+ )
|