Archive for the ‘ Default ’ Category

 

GitStack – a simple Git server for Windows

Read full article | No Comments

I have recently been in need for a good Git server stack for my degree’s workshop project. For various reasons, the whole system has to run on Windows machines. While I was sure I could setup the complete system on my own, I was too busy to bother, with several exams coming up in February. [...]

Read More

Text-based Macro System for F#

Read full article | No Comments

One feature I’ve seen repeatedly people wishing is a macro system, so I went ahead and tweaked the compiler to add a text-based macro system. I’m warning here and now: this is only a prototype, it is imperfect and definitely incomplete. The current version uses in-place text replacement on compilation time, using precompiled macros (functions [...]

Read More

The Lazync Computation Expressions

Read full article | 3 Comments

There is lately quite a lot of fuss over C# 5.0, caused by the new async features. The C# async feature is based on (or was inspired by) the F#’s Async computation expression, which I will now discuss a bit (and then present my improvement). Usually, async code works in to ways – sequential (wait [...]

Read More

Taking Computation Expressions one step further

Read full article | 3 Comments

In this article, I will present an extension to the F# compiler (I used November 2010 CTP from the F# PowerPack site). I was inspired by two things. The first was an old attempt to create a computation builder for XML/HTML objects, which wasn’t very successful because of the lack of options in computation expressions [...]

Read More

Implementing Haskell classes in F#

Read full article | No Comments

Haskell got a nice system of classes. Though the name reminds us of the OOP term, these “classes” are very different in their use. Here is an example for people who are not familiar with Haskell classes: Ideally, our F# code would look like: Without editing the compiler (I am going to consider writing an [...]

Read More

Being responsible when using tail recursion and exceptions

Read full article | 1 Comment

One very popular habit in F# is tail recursion. Tail recursion allows you to recurse without worrying about stack overflow. But there is a very dangerous problem – infinite recursion. Now, let’s say we have a function which doesn’t have a name which indicates it might fail (with StackOverflowException, InfiniteRecursionException, ArgumentOutOfRangeException etc.). An innocent reader [...]

Read More

The IO Monad for F#

Read full article | No Comments

If you have any experience in Haskell, you know the IO monad. Some people think it just makes things ugly – but I think it is good, since we are functional programming and we should know when we are using an impure function. What we will do is to define an IO<’T> type and an [...]

Read More

F# and WPF/XAML

Read full article | No Comments

F# is a great language, but its support is a bit limited. For example, you can make a WPF project in F# but you cannot use XAML. In this post I will demonstrate how to create a simple calculator using F#, WPF and XAML. I did not compare the efficiency to the C# version, but I’m quite [...]

Read More