Matthew Manela's Blog
Translate This Page
Translate this page
ASP .NET MVC
MSDN Code Gallery
Visual Studio 2012
Visual Studio Gallery
Browse by Tags
Matthew Manela's Blog
Tagged Content List
Return type overloading in Haskell
Function overloading is very common in many programming languages like C# but most of the languages that I have used only support overloading based on function arguments. For example in C# there are several overloads on the String.IndexOf function where … Continue reading →
17 Jun 2011
Prime Factorization using Unfold in Haskell
I randomly yesterday started thinking about the unfoldr function in Haskell while working out at the gym (how nerdy is that, I am lifting iron but thinking of functional programming). Unfoldr take a single and an unfolding function and turns it into a list (the opposite of fold). At the gym I was thinking...
17 Mar 2009
Parameterized State Transformer Monad in F#?
I have have been playing around with F# and I decided to create a state monad. This worked out really well since I was able to leverage the F# computation expressions . I then decided to try to extend this and make it more general by creating a parameterized state transformer monad. This is a state monad...
5 Nov 2008
Writing a Regular Expression parser in Haskell: Part 4
With the previous two modules in place we are now set up to use a DFA to match against a string. In my implementation I support either a greedy match or an short match. In a full featured regular expression engine this ability to choose greedy or not would be per operator but for simplicity I have...
21 Jun 2008
Writing a Regular Expression parser in Haskell: Part 3
The third module in the simple regular expression parser is called: NFAtoDFA. Which as you might have guessed, takes the NFA that resulted from the first module and converts it into a DFA. The structure that the DFA uses is the same that the NFA uses since they are both finite state machines. Converting...
10 Jun 2008
Writing a Regular Expression parser in Haskell: Part 1
A few weeks ago I read this article about writing a simple regular expression parser. That article does a really good job of explaining the theory behind regular expression. It then goes step by step into how to write a program (he uses C++) to parse a regular expression, convert it into a NFA, convert...
1 Jun 2008
Breadth First Tree Traversal in Haskell
As my interest in functional languages has grown, I have become increasingly interested in using them to implement algorithms which I can already write with imperative languages. For example, I was taught to implement (and I assume most other people as well) a breadth first traversal of a tree using...
11 May 2008
When I am finally starting to get a handle on Monads...
When I am finally starting to get a handle on Monads I discovered Arrows and I am thrown back into confusion. At least that is how it feels. In my exploration of Haskell I have spent a good deal of time trying to completely grasp and understand Monads. I have read much about it and feel pretty good about...
6 Apr 2008
Lazy Prime Number Sieve in C#
In my last post I talked about a Stream class for creating efficient lazy lists in C#. In addition, I showed several classic functional methods I ported to C# to be used on the lazy lists. As I mentioned in that post, I will now talk about an example I included in the source code for the lazy list class...
17 Mar 2008
Digging deeper into C# Lazy Lists
One of the most interesting aspects of the Haskell language is the fact that features lazy evaluation. My interest in lazy evaluation led me to a post on Wes Dyers blog about lazy lists in C#. In his blog post he talks describes how to create a lazy list class in C# and demonstrates some classic lazy...
15 Mar 2008
Who would have thunk it?
I recently read this article about Lazy Computation in C# . What the article discusses is creating lazy evaluation in C#. Lazy evaluation is a key feature of functional languages like Haskell but is not common in imperative languages. It is used in Haskell because it implements parameter passing on a...
19 Dec 2007
Lambda Expressions are more fun in Visual Basic .NET
I love C# and I would never want to do anything to make it seem any less amazing but I have to give credit where credit is due ... to Visual Basic .NET. Yes, I said it. Both languages have been adding features inspired by the functional and dynamic programing world. However, VB .NET has went a few steps...
7 Dec 2007
Page 1 of 1 (12 items)
© 2015 Microsoft Corporation.
Privacy & Cookies