Facebook
From Toxic Camel, 3 Years ago, written in OCaml (Objective Caml).
This paste is a reply to Untitled from Speedy Porcupine - go back
Embed
Viewing differences between Untitled and Re: Untitled
let matrix m =
  match m with 
=                                   
  let remove_first_two = function                
  | (h1 :: h2 :: t) -> List.rev t
  
t                
  | _ -> raise (Invalid_argument "invalid list") 
  in                                             
  
let aux t = 
    match t with
remove_last = function                     
    | h :: t -> List.rev t
    
t                       
    |_ -> raise (Invalid_argument "invalid list")
  
in aux mremove_last (remove_first_two m)