Skip to content
Snippets Groups Projects
Commit 55f38f26 authored by Taddeus Kroes's avatar Taddeus Kroes
Browse files

funclang series3: Prettified ass 7.5 (map).

parent e3902d0a
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,11 @@ let zip l m =
;;
(* 4 *)
let rec map f l = if length l = 0 then [] else (f (hd l))::(map f (tl l));;
let rec map f l =
match l with
| [] -> []
| h::t -> f h::map f t
;;
(* 5 *)
let rec reduce f z l =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment