IResult – A Robust Option Type for C#

Jeremy Madden. CodeProject. 2017-06-09.
The features introduced in C# 7.0 make it just a little easier to introduce some functional-programming style patterns into enterprise C# code. One of the features that had me particularly excited was pattern matching, particularly in switch blocks.
IResult utilizes some of these new features to emulate an the Option type from F#, including helper functions like Bind, Map and Fold.

[IResult – A Robust Option Type for C#]

The .NET Language Strategy

Mads Torgersen. .Net Blog. 2017-02-01.
I am constantly aware of the enormous impact our language investments have on so many people’s daily lives. Our languages are a huge strength of the .NET platform, and a primary factor in people choosing to bet on it – and stay on it.
I’ve been here on the .NET languages team at Microsoft for more than a decade, and I’ve always seen us have developers’ interests first and foremost in our minds as we moved the languages forward. The open source revolution (of not just the .NET languages but the whole .NET stack) has improved the conversation dramatically, and – I think – helped us to make better choices. However, we haven’t always been good at sharing how we make those decisions: Our language strategy; the framework for how we think about each of our .NET languages and chart their evolution.
This post is meant to provide that additional context for the principles we use to make decisions for each language. You should consider it as guidance, not as a roadmap.

[The .NET Language Strategy]

Programming in the Point-Free Style

Eirik Tsarpalis’ blog. 2017-04-02.
Point-free programming (or point-less programming, for the more cynically inclined) is a paradigm that advocates the formulation of programs by means of function composition. In the point-free style programs avoid explicitly nominating function arguments (or “points”), deriving instead complex function definitions by means of applying higher-order combinators on simpler functions.
[ Eirik Tsarpalis’ blog]


TypeShape is a small, extensible F# library for practical generic programming
TypeShape is a small, extensible F# library for practical generic programming. Borrowing from ideas used in the FsPickler implementation, it uses a combination of reflection, active patterns and F# object expressions to minimize the amount of reflection required by the user in such applications.
TypeShape permits definition of programs that act on specific algebrae of types. The library uses reflection to derive the algebraic structure of a given  System.Type  instance and then applies a variation on the visitor pattern to fully access specific type information.
TypeShape is not a metaprogramming library and does not emit code at runtime.



Salsa is an experimental Haskell library and code generator that allows Haskell programs to host the .NET runtime and interact with .NET libraries. It uses type families extensively to provide a type-safe mapping of the .NET object model in the Haskell type system.


Langton’s Ant in F#

It has been almost a year since I blogged, been busy with too many things so couldn’t find the time. In my new organisation we interviewed a fresher and while discussing on what coding problem to give we finalised on Langton’s Ant problem. We asked the candidate to implement a minimal console based version which can print each step of the Ant journey on the plane.

[Langton’s Ant in F#]