Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » F#   (RSS)

F# Performance Tweaking

Jomo Fisher—I’ve enjoyed reading the blog series on F# and game development here . Joh had posted an example of F# of using RK4 and showed some performance numbers comparing F# to C++ and OCaml. Don Syme had been reading too and asked if anyone on the
Posted by Jomo Fisher | 5 Comments
Filed under: , ,

Programmatically Resolve Assembly Name to Full Path the Same Way MSBuild Does

Jomo Fisher—Every once in a while I find I need to turn and assembly name like “System” or “System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL” into a path to the actual file for that assembly. This
Posted by Jomo Fisher | 5 Comments
Filed under: ,

Correct by Construction in F#

Correct by Construction in F# Jomo Fisher—a theme in the design of the F# language is that problems in the code are revealed as compilation errors. Consider this C# code which is used to compose a courteous letter to a customer: enum Courtesy { Mr, Ms,
Posted by Jomo Fisher | 8 Comments
Filed under: ,

Strange Confluence: An Immutable Queue in F#

Jomo Fisher--Reading one of my favorite blogs this morning--Eric Lippert's Fabulous Adventures in Coding--I came across his article on implementing an immutable queue in C#. The funny thing is that just yesterday I wrote exactly the same structure in
Posted by Jomo Fisher | 1 Comments
Filed under: , , ,

Tight Code--A Puzzle in F#

Jomo Fisher--Luke Hoban wrote something in a blog entry that resonated with me: One of the most striking features of F# code is that it is very terse - ideas can typically be expressed with a small amount of code. Don Syme once mentioned (I'm paraphrasing)
Posted by Jomo Fisher | 37 Comments
Filed under: ,

The Least a C# Programmer Needs to Know about F# Part II--Modules

Jomo Fisher--Many languages, especially those in the OO vein, require an outermost class to put code in. Usually, good practice requires an enclosing namespace as well. F# allows functions and even function calls in the outermost scope. Here is the minimal
Posted by Jomo Fisher | 3 Comments
Filed under:

WideFinder--Naive F# Implementation

Jomo Fisher--Here's an interesting problem that some people are having fun with. Don Box posted a naive implementation in C# so I thought I'd post the equivalent in F#: #light open System.Text.RegularExpressions open System.IO open System.Text let regex
Posted by Jomo Fisher | 4 Comments
Filed under:

The Least a C# Programmer Needs to Know about F# Part I--Implicit Types

Jomo Fisher--A few weeks ago, a fellow C# programmer asked me what the biggest differences between programming in C# and programming in F# are. Since then, I've been building a list of differences. My plan was to write a single article that discussed
Posted by Jomo Fisher | 6 Comments
Filed under: ,

Adventures in F#--Sweet Test-First Kung Fu

Jomo Fisher--Up until now, I've been avoiding using F# with the VS IDE. I've been using notepad.exe and fsc.exe because I wanted to build my own expectation for what the experience should be before I experienced what it actually was. I can tell you that
Posted by Jomo Fisher | 3 Comments
Filed under:

Adventures in F#--Lazy Like a Fox

Jomo Fisher--This is the next part of the open-notebook series documenting my exploration of F#. Today, I'm looking at the lazy keyword. When an F# function is invoked its value is immediately evaluated. F# does not do lazy evaluation by default. However,
Posted by Jomo Fisher | 3 Comments
Filed under:

Adventures in F#--Corecursion

Jomo Fisher--In a prior post I touched on recursion in F#. One of the comments was about mutually recursive functions. The example given was, let f1 a do print a f2 a let f2 a do print a f1 a f1 1 It turns out that this F# doesn't compile because F# scoping
Posted by Jomo Fisher | 4 Comments
Filed under: ,

Adventures in F#--Tail Recursion in Three Languages

Jomo Fisher—Here’s the F# I'm looking at today: #light let rec f n = do printf "%d\n" n f (n+1) f 1 This defines a recursive function 'f' that takes a value 'n' as a parameter. This function prints the value of n to the console and then calls itself with
Posted by Jomo Fisher | 12 Comments
Filed under: , , ,

Adventures in F#--Discriminated Unions

Jomo Fisher-- Easily my favorite feature of F# so far is the combination of discriminated union and pattern matching. Together, these allow you to concisely represent a complex language-like data structure and operations over that structure. We used this
Posted by Jomo Fisher | 7 Comments
Filed under:

Adventures in F#--Probing Type Inference

Jomo Fisher--I was curious about type inference in F# and I wondered what would happen if there was really no way for the compiler to infer a type. Consider this function which takes a value and just returns it: let func n = n Like last time , I compiled
Posted by Jomo Fisher | 12 Comments
Filed under:

Adventures in F#--The Lay of the Land

Jomo Fisher--I'm taking some time now to better understand F#. Right now, I understand the concept of functional code and have some narrow but deep experience by way of the work we did on LINQ for C# 3.0. My goal is to understand F# as well as I understand
Posted by Jomo Fisher | 5 Comments
Filed under:
 
Page view tracker