Yan Cui's blog articles

0
comment
on 10/9/2011 4:17 AM
In F#, you have the choice of using a struct or a record as a lightweight container for data. The similarities between the two are striking – both are immutable by default, neither can be inherited, and they both offer structural equality semantics by default too! However, there’s a key difference between them, their performance [...]
>> Read the full article
.
0
comment
on 10/8/2011 3:39 PM
In my previous post on discriminated unions, I presented discriminated unions as an alternative to standard .Net classes to represent hierarchical data structures. However, in terms of data structure, discriminated unions share much more similarities with enums than they do classes – both allow you to define a set of named constants and associate some [...]
>> Read the full article
.
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
.
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