Strangelights

Another tech blog.

 

Aspf Demo

Published: 2005-08-28

I have update the Aspf Demo so it now utilises F# 1.1 ablity to define classes. It now also inculdes a web serverice. Enjoy!

http://www.strangelights.com/fsharp/AspfDemo/

Continue reading ...

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>

A couple of days ago Chris Sells made this post about the way best to parse command line augments. Given an xml document describing the structure of a command line augment, he wants to know would it be best to use code gen or an interpreter to parse command line arguments. Here is the xml structure he was talking about.

 

Continue reading ...

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p>

Last time we took a look at folding. It may not have escaped the readers notice that some operations are dependent on the order the parameters are processed. For instance in the string concatenation example the order the parameters are processed affects the order they appear in the output string. But in this example to reverse the order of result does not actually require access to the list in both directions, it is only necessary to reverse the order that the parameters are concatenated in:

 

Continue reading ...

Late there has been quite a lot of talk about functional programming in C#. Efforts by Don Box, have been note and used on this blog several times and now that and now Sriram Krishnan has produced this nice piece on currying in C# 2.0.

 

One area that seams to have been over looked so far is folding. A folding function is similar to a mapping function and mapping functions are supported by the framework library in version 2.0, expect it calls it ConvertAll. For example, the framework defines the following method on the List<T> class:

Continue reading ...

 

Comments

Published: 2005-06-23

I had to disable comments temporally because I am receiving large amounts of spam. They will be back as soon as I have the time to implement an anti-robot solution.

Continue reading ...

A couple of weeks ago Don Box made a post about dynamic evaluation in C#. Since a console and dynamic evaluation are popular feature request for F# I decided to have ago at implementing this in F#. The results can be found here.

 

At the moment it’s pretty limited, you can just evaluate an express and the result will get thrown away, only values that are not functions will be evaluated properly, there’s no error handling and the printing of the output types is a little limited. It's only been tested with Framework 2.0, although it should (in theroy) work with all frameworks. I hope to work on removing these limitations and more add more features, to eventually produce a useful tool.

Continue reading ...

Don Box made another post on Continuations and Closures that made me realised I’d made a mistake in my last post. I had not used continuation; I merely used a closure that captured some mutable variables. Also F#/Caml does not have continuations in the same way Ruby does. F# does however have continuation style passing, also discussed in Mr. Box aforementioned post.

 

Anyway I thought I’d write a sort piece to show continuation style passing in action in F# , using my old favourite the Fibonacci series. Consider the following recursive code function that calculated the Fibonacci series.

Continue reading ...

The ever charismatic Mr. Box made a lovely post about continuations in C# 2.0:

http://pluralsight.com/blogs/dbox/archive/2005/04/17/7467.aspx

 

Continue reading ...

 

F Sharp Wiki

Published: 2005-04-10

I haven’t had a lot of time lately to update my FSharp site, as I’ve been very busy with at work. I thought it would be a neat idea if other people could update it too, so I have created the FSharpWiki. Have and look and remember YouAreEncouragedToChangeTheWiki.

Continue reading ...

People interested in the advantages for F# might do well to take a look at F# option type. This allows an F# programmer to specify the presents or absence of some data much the same way a C# programmer might use a null reference.

 

Let us take a quick look at how you might use the option type. It is implemented as a discriminating union so can be investigated with F#’s pattern matching constructs.

Continue reading ...