From 6ea147406e97fd7265ed40b6bea313d878ed2479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Bene=C5=A1?= Date: Thu, 5 May 2022 19:31:00 +0200 Subject: [PATCH] Remove safe map example --- examples/safeMap.ccb | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 examples/safeMap.ccb diff --git a/examples/safeMap.ccb b/examples/safeMap.ccb deleted file mode 100644 index 31c9b4f..0000000 --- a/examples/safeMap.ccb +++ /dev/null @@ -1,19 +0,0 @@ -// this map takes a safe function: if you give it a pure function -// together with a list of safe elements, it returns a list of safe elements -let sMap(safe f, lst) = - match lst with - | [] => [] - | (head :: tail) => - let newHead = f(head) in - let newTail = sMap(safe f, tail) in - newHead :: newTail - -let testList = 1 :: 2 :: 3 :: [] -let safe square(x) = x * x -let saf = sMap(safe square, testList) - -let safe sSquare(safe x) = x * x -let testSafeList = safe 1 :: safe 2 :: safe 3 :: [] -let saf2 = sMap(safe sSquare, testSafeList) - -