Vb Catch When Why So Special

The VB Catch syntax has a particular feature not present in C#: When. It allows users to filter expressions based on something other than their type. Any arbitrary code can enter a When block to decide whether or not to handle an Exception

Functional C#&58; Providing an Option Part 2

In my previous post I discussed creating an Option style construct for C#/.Net. This post is a followup with the complete code snippet. It’s been updated in response to several bits of feedback I received. Namely

Unfold

F# has a handy method called Unfold. Think of it as the logical opposite of an Aggregate function. Aggregates take a sequence of elements and convert them to a single element. An unfold method will take a single element and turn it into a (potentially infinite) sequence of elements.

Functional C#: Providing an Option

Sorry for the terrible pun in the title. I wanted to blog about developing an F# style Option class for C# and I couldn’t resist.

When Is A Long Not A Long

Answer: When PInvoke is involved.