Tuesday, March 4, 2008

Learning F# - List Concatenation

My first attempt with lists in F# :-)

let lofl = [[1;2];[3;4];[5;6]]

let rec concat ll =
match ll with
| [] -> []
| h :: t -> h @ concat t

printf "%A" (concat lofl)
read_line()

No comments:

Post a Comment