From a7d7542dc646a5fd124ef71e71ce260889f1701b Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Tue, 2 Feb 2016 19:24:50 +0100 Subject: Moved to 1415 directory --- 1415/fp2/week3/mart/NotatieDynamics.icl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 1415/fp2/week3/mart/NotatieDynamics.icl (limited to '1415/fp2/week3/mart/NotatieDynamics.icl') diff --git a/1415/fp2/week3/mart/NotatieDynamics.icl b/1415/fp2/week3/mart/NotatieDynamics.icl new file mode 100644 index 0000000..da90675 --- /dev/null +++ b/1415/fp2/week3/mart/NotatieDynamics.icl @@ -0,0 +1,25 @@ +module NotatieDynamics + +import StdEnv +import StdDynamic, StdDynamicFileIO + +Start = f4 f3 + +f1 :: Int Int -> Int +f1 (x :: Int) y = x + y + +f2 :: Bool a a -> a +f2 (b :: Bool) (e1 :: a) (e2 :: a) = dynamic if b e1 e2 :: a + +f3 :: [Int] +f3 = dynamic map fib [1 ..] + +fib 0 = 1 +fib 1 = 1 +fib n = fib (n-1) + fib (n-2) + +f4 :: [Int] -> [Int] +f4 (xs :: [Int]) = take 10 xs + +f5 :: [Int] -> [Int] +f5 = f4 f3 -- cgit v1.2.3