Browse by Tags

Tagged Content List
  • Blog Post: Use FsLex and FsYacc to make a parser in F#

    Update: The template I posted yesterday was for PowerPack 1.9.9.9 which is not the most recent version available. I have since updated the template to target PowerPack 2.0.0.0. If you installed the old template you may need to uninstall at Tools\Extension Manager... ----------------------------- ...
  • Blog Post: Creating an OData Web Service with F#

    Jomo Fisher—I’ve spent a little time looking at the OData Web Service Protocol . There is quite a lot to like about it. It is an open, REST-ful format for communicating with a web service as if it were a database. You can query an OData service with LINQ. To help me learn about it I set out to write...
  • Blog Post: F# Object Oriented Programming

    Jomo Fisher—F# has a functional heritage but it is actually very good at OO as well.  Here’s an example of its nice, clean syntax for declaring a class: Code Snippet type Vector(x : float, y : float) =      member this.X = x      member this.Y = y Tim Ng posted a nice comparison of F# to C# for...
  • Blog Post: How to Enumerate all WMI Classes

    Jomo Fisher—Quick sample today. I’m mainly posting this because it took me a while to figure it out and I hope it might save someone some time. This is the F# code you would useto enumerate all WMI classes on your system and show the properties of each. of each. Code Snippet...
  • Blog Post: F# Destroys Invading Aliens

    Wow, check out Chris’s StarCraft bot in F#: http://blogs.msdn.com/chrsmith/archive/2010/03/18/writing-a-starcraft-bot-in-f.aspx
  • Blog Post: F# Team is Hiring a Cross-Platform Developer

    We’re hiring a developer to help advance our cross-platform presence. Please do send and application if this looks like a good match for you. From Don Syme’s blog:   Contract Position in the F# Team: Compiler and Visual Tools Software Engineer for Cross-Platform F# We are now seeking applications...
  • Blog Post: Neat Samples: MEF in F# Scripts

    Jomo Fisher—I posted yesterday about using MEF in F# programs. In the comments Oldrich asked if it was possible to do the same thing in F# scripts. It is indeed possible. It actually looks like a really powerful combination because you can naturally extend your scripts just by adding new #load directives...
  • Blog Post: Neat Samples: Extend your F# program with MEF

    Jomo Fisher—The Managed Extensibility Framework is an interesting new technology in .NET 4.0. It lets you set up a plug in system for your application so that your program can acquire new functionality just by, for example, adding a .dll into a particular directory. This is a simple example in F#. This...
  • Blog Post: Neat Samples: F#, Freebase and DGML

    Jomo Fisher – I recently posted about the freebase web service here . This sample reads biological classifications and renders them in DGML. The result is a huge graph, here’s a little piece of it: Code Snippet // FreebaseDgml.fsx // Example of reading from freebase.com in F# using DataContract and JSON...
  • Blog Post: Neat Sample: F# and Bing API

    Jomo Fisher – I recently posted an sample of calling the Freebase web service with F#. Here’s another F# web service sample. This one uses the Bing Phone API to do a query. This time the code uses Xml instead of JSON and XmlDocument instead of a DataContract deserializer. This is pretty much a straight...
  • Blog Post: F# Scripting, .NET 4.0 and Mixed-mode assemblies

    Jomo Fisher—There is a nice F# and DirectX demo that has been floating around for a while now. A recent version can be found here: http://code.msdn.microsoft.com/fsharpsamples/Wiki/View.aspx?title=Home&version=2 One of the recent problems we’ve seen is that, because of the support for side-by-side...
  • Blog Post: 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 F# team wanted to take a stab to see if they could...
  • Blog Post: 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 is a tricky problem considering the assembly name...
  • Blog Post: 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, Dr } class Customer { public Courtesy...
  • Blog Post: 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 F#. Here it is for your reading pleasure: type...
  • Blog Post: 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) that an aspirational goal for F# in the beginning...
  • Blog Post: 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 F# program: printf "Hello!" Really, that's the...
  • Blog Post: 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 = new Regex( @"GET /ongoing...
  • Blog Post: 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 everything. This morning the list got too long to...
  • Blog Post: 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 I didn't expect the sweet experience of using the...
  • Blog Post: 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, laziness can be useful and F# provides an easy...
  • Blog Post: 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 rules are different than what you might expect...
  • Blog Post: 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 n+1. So we've defined a function that will count...
  • Blog Post: 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 pattern extensively in LINQ to SQL (though in...
  • Blog Post: 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 this with fsc.exe. I was expecting a polite error...
Page 1 of 2 (26 items) 12