Welcome to MSDN Blogs
Sign in
|
Join
|
Help
Jomo Fisher -- Sharp Things
This Blog
Email
Syndication
RSS 2.0
Atom 1.0
Search
Go
Tags
.NET Futures
C#
C++\CLI
Code Quality
Data Structures
Design Patterns
F#
Immutable
Manycore
MSBuild
Multicore
Performance
Puzzle
Archives
September 2008 (1)
August 2008 (3)
May 2008 (1)
April 2008 (1)
December 2007 (1)
November 2007 (1)
October 2007 (6)
September 2007 (8)
August 2007 (2)
July 2007 (3)
June 2007 (1)
May 2007 (4)
March 2007 (1)
March 2006 (1)
November 2005 (1)
October 2005 (1)
September 2005 (2)
August 2005 (1)
July 2005 (1)
May 2005 (4)
April 2005 (3)
February 2005 (1)
January 2005 (1)
November 2004 (1)
October 2004 (2)
September 2004 (5)
September 2007 - Posts
Thursday, September 27, 2007 6:51 PM
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:
F#
Monday, September 24, 2007 1:09 PM
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:
C#
,
F#
Wednesday, September 19, 2007 3:55 PM
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:
C#
,
Performance
,
F#
,
C++\CLI
Monday, September 17, 2007 5:16 PM
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
|
6 Comments
Filed under:
F#
Sunday, September 16, 2007 1:53 PM
Adventures in F#--Poking Tuples with a Stick
Jomo Fisher--In a comment on my bloglet about type inference in F# John Harrop suggested I try: let f (a,b)=(b,a) Which, under Reflector, gives this equivalent in C#: public static Tuple<U, T> f<T, U>(T a, U b) { return new Tuple<U, T>(b,
Posted by
Jomo Fisher
|
3 Comments
Friday, September 14, 2007 4:59 PM
Adventures in F#--Function Type Inference
Consider this F#: let Reverse a b = b a This means: given a and b (whatever they may be) call b as a function with 'a' as the argument. When I compile this and look at it under reflector I get: public static U ( ,Microsoft.FSharp.Core.FastFunc , >): "
Posted by
Jomo Fisher
|
6 Comments
Wednesday, September 12, 2007 3:20 PM
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:
F#
Wednesday, September 12, 2007 1:51 PM
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:
F#