Commit bb44b218 authored by Kim Nguyễn's avatar Kim Nguyễn
Browse files

Add a map/even test case.

parent d74eb9b6
Pipeline #162 passed with stages
in 7 minutes and 15 seconds
......@@ -22,6 +22,14 @@
(rule (alias lazy) (action (diff lazy.exp lazy.out)))
; end: lazy.cd
; begin: map_even.cd
(rule (deps map_even.cd) (target map_even.cdo)
(action (ignore-outputs (with-accepted-exit-codes 0 (run cduce --compile %{deps})))))
(rule (deps map_even.cdo) (target map_even.out)
(action (ignore-stderr (with-stdout-to %{target} (with-accepted-exit-codes 0 (run cduce --run %{deps}))))))
(rule (alias map_even) (action (diff map_even.exp map_even.out)))
; end: map_even.cd
; begin: overloading.cd
(rule (deps overloading.cd) (target overloading.cdo)
(action (ignore-outputs (with-accepted-exit-codes 0 (run cduce --compile %{deps})))))
......@@ -44,6 +52,7 @@
(alias addrbook)
(alias integers)
(alias lazy)
(alias map_even)
(alias overloading)
(alias web_site)
))
let fun fmap (('a -> 'b) -> ['a*] -> ['b*]) f ->
(fun (['a*] -> ['b*]) [] -> [] | (h, t) -> (f h, fmap f t) )
;;
let fun even (Int -> Bool; ('c \ Int) -> ('c \ Int)) x & Int -> x mod 2 = 0 | y -> y;;
let l = fmap even [1 2 3 4 `HELLO ]
let [] = print (string_of l);;
\ No newline at end of file
[ `false `true `false `true `HELLO ]
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment