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]


Comments: Post a Comment

Subscribe to Post Comments [Atom]





<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]

Watch the latest videos on YouTube.com