Yan Cui's blog articles

0
comment
on 9/30/2011 5:34 PM
By default, tuples, discriminated unions and records have what is known as structural equality – i.e. if two instances of these types have the same set of values then they are considered equal, just like value types – despite being reference types: Tuples Discriminated Unions Records To facilitate this form of equality, the F# compiler [...]
>> Read the full article
.
0
comment
on 9/28/2011 5:30 PM
Pattern matching is everywhere in F#, you can use it in let bindings, in function parameters, in for loops, everywhere, and it is totally amazing. It is in my opinion one of the best features of F#, and in functional languages in general, heck, Erlang goes as far as not having an assignment operator and [...]
>> Read the full article
.
0
comment
on 9/28/2011 5:15 AM
Ayande posted a tax calculation challenge the other day here, and here’s my F# solution for the challenge: Enjoy!
>> Read the full article
.
0
comment
on 9/28/2011 3:51 AM
When you consider the age old problem of representing different shapes (circle, triangle, square, rectangle, etc.) my OO fed developer brain naturally jumps to a class hierarchy along the line of: This is perfectly fine and legit, but it’s not the only way to approach things. Since I’ve been on a more varied diet of [...]
>> Read the full article
.
0
comment
on 9/27/2011 3:00 AM
C# developers should be familiar with the yield keyword that was introduced in C# 2.0, and you’ll be pleased to know that F# also has the yield keyword which works in conjunction with F#’s equivalent of IEnumerable – sequences. You can create sequences in F# using sequence expressions: In addition, you can also use the [...]
>> Read the full article
.
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper