Skip to content

Instantly share code, notes, and snippets.

@fwaris
fwaris / DataExploration.fsx
Created October 11, 2019 12:04
Kernel Density estimation and visualization to compare multiple distributions together
#r @"..\packages\MathNet.Numerics.FSharp.4.8.1\lib\net45\MathNet.Numerics.FSharp.dll"
#r @"..\packages\MathNet.Numerics.4.8.1\lib\net461\MathNet.Numerics.dll"
#r @"..\packages\FSharp.Plotly.1.1.21\lib\net47\FSharp.Plotly.dll"
#r @"..\packages\FSharp.Data.3.1.1\lib\net45\FSharp.Data.dll"
open FSharp.Data
open MathNet.Numerics
open FSharp.Plotly
(*
Sample based on NY Taxi data
@fwaris
fwaris / FsJson.fs
Last active January 18, 2020 10:54
FsJson.fs a fast document-oriented json parser for F#
module FsJson
open System
open System.Text.RegularExpressions
open System.Text
open System.IO
open System.Globalization
type Json =
| JsonObject of Map<string,Json>
| JsonString of String
@fwaris
fwaris / SolverFoundationSudoku
Created April 30, 2011 13:19
Solve Sudoku with Solver Foundation and F#
//update the paths below to correctly reference the external resources
#r @"C:\ws\ReferenceAssemblies\Solver30\Microsoft.Solver.Foundation.dll"
#load @"C:\Users\Fai\Documents\Microsoft Solver Foundation\Samples\FSharp\SfsMeasures\SfsWrapper.fs"
;;
open Microsoft.SolverFoundation.Services
open Microsoft.SolverFoundation.SfsWrapper
;;
let sudokuPuzzle =
//9x9 matrix as list of 81 cells
//use 0 for blank cell
module ComMonad
//type ComOp<'T> = (unit -> 'T)
let private runCom t = t()
type Com =
static member Run t = runCom t
let private result t = (fun () -> t)
let private delay (f:unit->unit->'a) = (fun() -> f()())