Leal9001

Aula 2

Mar 12th, 2018
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.19 KB | None | 0 0
  1. let rec ins v ll =
  2.     match ll with
  3.     | [] -> []
  4.     | l::ls -> (v :: l) :: ins v ls
  5.  
  6. let rec power l =
  7.     match l with
  8.     | [] -> [[]]
  9.     | x::xs -> ins x(power xs) @ power xs ;;
  10.  
  11. power [1;2;3] ;;
Advertisement
Add Comment
Please, Sign In to add comment