Yan Cui's blog articles

0
comment
on 11/7/2011 4:43 PM
Indexer If your have a type that represents a collection of values, adding a custom indexer gives you a natural way to index directly into the object using the .[ ] operator. Take this simple Calendar class for instance, which keeps a map (F# equivalent of a Dictionary<TKey, TValue>) of notes against DateTime values: By [...]
>> Read the full article
.
0
comment
on 10/19/2011 1:00 PM
Normally, with languages like C# or Java, there is quite a bit of overhead in creating a quick and dirty program to do small tasks like bulk renaming files in a director, etc. This is the spot that is filled by scripting languages like Python, Perl and Ruby, but did you know that you can [...]
>> Read the full article
.
0
comment
on 10/16/2011 2:39 PM
I touched on the topic of memoization in the past in relation to doing aspect-oriented programming with PostSharp, however, with functional languages like F#, Haskell or Erlang there is no such frameworks (although PostSharp should still work with F# to some extent) to help you. That’s not to say that you can’t do AOP in [...]
>> Read the full article
.
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
.
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