Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open Thread
- open Event
- let rec tmap f ls =
- let c = new_channel () in match ls with
- | [] -> []
- | h::t -> let _ = create (fun c -> sync (send c (f h :: tmap f t))) c in
- sync (receive c)
- # tmap (fun a -> a + a) [1;2;3;4;5;6];;
- - : int list = [2; 4; 6; 8; 10; 12]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement