summaryrefslogtreecommitdiff
path: root/files/practicum/NotatieFuncties.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/NotatieFuncties.icl
parentMerge branch 'master' of https://github.com/dopefishh/fp1 (diff)
added practicum files, updated gitignore
Diffstat (limited to 'files/practicum/NotatieFuncties.icl')
-rw-r--r--files/practicum/NotatieFuncties.icl34
1 files changed, 34 insertions, 0 deletions
diff --git a/files/practicum/NotatieFuncties.icl b/files/practicum/NotatieFuncties.icl
new file mode 100644
index 0000000..87c9b8a
--- /dev/null
+++ b/files/practicum/NotatieFuncties.icl
@@ -0,0 +1,34 @@
+module NotatieFuncties
+
+import StdEnv
+
+f1 :: Int
+f1 = 1 + 5
+
+f2 :: Int
+f2 = (+) 1 5
+
+f3 :: Int Int -> Int
+f3 m n
+| m < n = m
+| otherwise = n
+
+f4 :: String Int -> String
+f4 s n
+| n <= 0 = ""
+| otherwise = s +++ f4 s (n-1)
+
+f5 :: Int Int -> Int
+f5 x 0 = x
+f5 x y = f5 y (x rem y)
+
+f6 :: (Int,Int) -> Int
+f6 x = fst x + snd x
+
+f7 :: (a,b) -> (b,a)
+f7 (a,b) = (b,a)
+
+f8 :: (a,a) -> (a,a)
+f8 x = f7 (f7 x)
+
+Start = f1