From 379b6353396ca2401241d714733d570629835ffe Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Fri, 6 Feb 2015 08:39:37 +0100 Subject: added practicum files, updated gitignore --- files/practicum/EersteIsLaatste.icl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 files/practicum/EersteIsLaatste.icl (limited to 'files/practicum/EersteIsLaatste.icl') 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 -- cgit v1.2.3