Skip to content

Instantly share code, notes, and snippets.

View pmbanka's full-sized avatar

Paweł Bańka pmbanka

View GitHub Profile
@kos59125
kos59125 / RandomAccessList.fs
Created September 14, 2012 09:43
Purely Functional Random Access List in F# (Okasaki 1995)
module RandomAccessList
open System
let indexOutOfBounds = ArgumentOutOfRangeException ("index")
let emptyList = ArgumentException ("Empty list")
type Tree<'a> =
| Leaf of 'a
| Node of 'a * 'a Tree * 'a Tree
@robertpi
robertpi / gist:2964793
Created June 21, 2012 09:18
F# record implementing an interface
namespace MyNamespace
type IMyInterface =
abstract GetValue: unit -> string
type MyRecord =
{ MyField1: int
MyField2: string }
interface IMyInterface with
member x.GetValue() = x.MyField2
@ovatsus
ovatsus / Setup.fsx
Created March 17, 2012 17:07
Script to setup F# Interactive session, loading everything in the current solution
#r "System.Xml.Linq"
open System
open System.IO
open System.Xml.Linq
let script = seq {
//TODO: this currently loads fsproj's in alphabeticall order, we should instead
//build the dependencies graph of the fsproj's and load them in topological sort order