val sum : int = 8 > printf "%d" sum;; 8val it : unit = ()
And now, we want to do Currying for this function. How should we do?
val sum : int = 8 > printf "%d" sum;; 8val it : unit = ()
A list in F# is an ordered, immutable series of elements of the same type.Each elements are separated by semicolons.
> let integer_list = [1; 2; 3];; val integer_list : int list = [1; 2; 3] > let string_list = ["a"; "b"; "c"];; val string_list : string list = ["a"; "b"; "c"]
> let rec fibonacci n = if n=0 then 0 elif n=1 then 1 else fibonacci(n-2) + fibonacci(n-1);; > for i in [0..10] do - let fibn = fibonacci i - printfn "%d" fibn - done;; 0 1 1 2 3 5 8 13 21 34 55 val it : unit = ()