Custom Search
Monday, October 26, 2009
What is '::' in F#? What is Cons in FSharp?
As a novice F# developer, I was wondering; what is mean by '::' sign. I saw that people are using it every now and than. '::' means Cons. 'Cons' is the fundamental concept of computation programming with linked list. I got to know it from one of the Chris Smith's blog about List. Cons can be used to add an element at beginning of the list.
for example:
> 11 :: [12 .. 14];;
val it : int list = [11; 12; 13; 14]
Subscribe to Posts [Atom]