summaryrefslogtreecommitdiff
path: root/files/practicum/EersteIsLaatste.icl
diff options
context:
space:
mode:
authorMart Lubbers2015-02-06 08:39:37 +0100
committerMart Lubbers2015-02-06 08:39:37 +0100
commit379b6353396ca2401241d714733d570629835ffe (patch)
tree26652c854a79c627b5f50bc8ac26f9b84f8e196d /files/practicum/EersteIsLaatste.icl
parentMerge branch 'master' of https://github.com/dopefishh/fp1 (diff)
added practicum files, updated gitignore
Diffstat (limited to 'files/practicum/EersteIsLaatste.icl')
-rw-r--r--files/practicum/EersteIsLaatste.icl19
1 files changed, 19 insertions, 0 deletions
diff --git a/files/practicum/EersteIsLaatste.icl b/files/practicum/EersteIsLaatste.icl
new file mode 100644
index 0000000..7665c5d
--- /dev/null
+++ b/files/practicum/EersteIsLaatste.icl
@@ -0,0 +1,19 @@
+module EersteIsLaatste
+
+import StdEnv
+
+last1 :: [a] -> a
+last1 [x] = x
+last1 [_:xs] = last1 xs
+
+last2 :: ([a] -> a)
+last2 = hd o reverse
+
+// 1.
+// Herschrijf de volgende Start-regels handmatig:
+Start = last1 [1,2,3,4]
+
+Start = last2 [1,2,3,4]
+
+// 2.
+// Verklaar het verschil tussen last1 en last2