Non-nullability in C# 8.0 and F# 4.1
Once in the past, I was wondering how many times I had written null
checks in C# so far. It must have been at least ten thousand times. Later, I discovered F#, which avoids null
in most cases…
Once in the past, I was wondering how many times I had written null
checks in C# so far. It must have been at least ten thousand times. Later, I discovered F#, which avoids null
in most cases…
This blog post explains five F#-specific features who simplify and stabilize the implementation of vector algebra: custom operators, inlining, units of measure, type inference and automatic generalization…
In C#, Fibonacci numbers are usually calculated with a loop. In F#, however, Fibonacci numbers can be calculated in at least eight different ways…
In this post, we are going to test the escaped concat
/split
functions that we implemented last time. Along the way, it will become apparent why F# is an ideal language for writing .NET unit tests.
The built-in .NET Join
and Split
methods do not provide a way for escaping the separator. If the separator is already contained in the input strings before joining, the strings cannot be reproduced by splitting…
In this post, we are going to create a Converter
class who converts values to strings. The conversion rules are specified by passing the name of a culture to the class’ constructor…
This article gives an overview how types are accessed in F# with a combination of features related to static typing, dynamic typing and type inference.
F# provides literal expressions for tuples, F# lists, arrays, sequences (enumerables) and other generic types. The elements of a tuple expression are separated by commas. The elements of all other kinds of list-like expressions are separated by semicolons…
C# 4.0 allows to declare variance compatibility for delegates and interfaces. This means, for instance, that one can assign an IEnumerable<Cat>
to an IEnumerable<Animal>
. The term variance compatibility, in this context, defines the kind of assignment compatibility between two closed generic types…
The library System.Numerics.dll, who was introduced in .Net 4.0, contains a System.Numerics.BigInteger
structure. BigInteger
represents a whole number of arbitrary size (or precision). Before .Net 4.0, the largest number that could be represented out of the box was System.Double.MaxValue
…