Skip to content

Instantly share code, notes, and snippets.

@jshurst
jshurst / FSharp Agent Logger.fs
Last active August 27, 2022 18:40
F# Agent Logger
namespace FSharpRulesEngine
open System
type LogMessageType =
| Information
| Exception
type ILogger =
@jshurst
jshurst / FSharp FizzBuzz Pattern Matching.fs
Last active July 19, 2016 10:54
F# FizzBuzz Pattern Matching
let x =
for c in [1..100] do
match c%3,c%5 with
| 0,0 -> printfn "FizzBuzz"
| 0,_ -> printfn "Fizz"
| _,0 -> printfn "Buzz"
| _ -> printfn "%d" c
@jshurst
jshurst / FSharp DB Record Mapping.fs
Last active August 29, 2015 14:03
F# DB Record Mapping
//Taken from here: http://fssnip.net/5E
//Given any of this kind (record)
type product =
{ProductId:int;
ProductName:string;
SupplierID:int;
CategoryID:int;
QuantityPerUnit:string;
UnitPrice:decimal;