Correct version of Fsharp.Core

You should not be obtaining FSharp.Core from nuget. Microsoft does not publish any official F# bits to nuget today (though this could potentially change in the future). It’s common for 3rd-party packages to bundle FSharp.Core (since presumably that’s the version used for testing/validation of that 3rd-party component), but nuget should not currently be used as … Read more

Avoiding stack overflow (with F# infinite sequences of sequences)

You should definitely check out http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/FSharp.PowerPack/Microsoft.FSharp.Collections.LazyList.html but I will try to post a more comprehensive answer later. UPDATE Ok, a solution is below. It represents the Morris sequence as a LazyList of LazyLists of int, since I presume you want it to be lazy in ‘both directions’. The F# LazyList (in the FSharp.PowerPack.dll) has three … Read more

Pretty print a tree

If you want it to be very pretty, you could steal about 25 lines of code from this blog entry to draw it with WPF. But I’ll code up an ascii solution shortly too, probably. EDIT Ok, wow, that was hard. I’m not certain it’s entirely correct, and I can’t help but think there’s probably … Read more

F# if not condition

if you consider that not is also a function, then you can pipe your condition into it to avoid parenthesis like so: if not <| condition param1 param2 then … reason being is if your condition function takes arguments, you don’t need to do not (condition param1 param2) it’s probably a little cleaner to do … Read more

Why can’t I add a subfolder in a F# project?

Actually, you can add folders to F# projects but it’s not supported directly through Visual Studio (you have to edit the project file yourself): http://fsprojectextender.codeplex.com/ (edit: old link was broken, updated to F# Project Extender home page which has links to the original blog posts which were moved) (which I found in this answer). I … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)