let rec prefixes l = match l with [] -> [] | x::xs -> [x] :: (List.map (fun a -> (x :: a)) (prefixes xs));;