Skip to content

Instantly share code, notes, and snippets.

@cloudRoutine
cloudRoutine / 01_folds.fs
Last active December 12, 2022 13:01
F# Transducers - they work for the most part
open System.Collections.Generic
open Microsoft.FSharp.Collections
[<RequireQualifiedAccess>]
module Folds =
// These are the fast implementations we actually want to use
@cloudRoutine
cloudRoutine / Microsoft.PowerShell_profile.ps1
Last active June 13, 2022 07:12
Powershell Profile for use with Cmder
# If this script is throwing an error near a Unicode symbol try resaving the file as UTF-8 with BOM
$psmodules = ";~\Documents\WindowsPowerShell\Modules"
# sometimes the module paths has been fucked before posh loads, but that won't stop us
$env:PSModulePath = $env:PSModulePath + $psmodules
# Set the OutputEncoding to Unicode so that the λ renders properly
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
@cloudRoutine
cloudRoutine / user-profile.ps1
Last active May 13, 2022 15:11
Posh Profile for Portable Cmder with Vim Config Instructions
# NOTE - If there are weird character errors when trying to load this profile
# resave the file with the encoding `UTF-8 with BOM`
# ┌ ┐
# Setup Environment
# └ ┘
# change to codepage to display symbols properly
chcp 65001 | out-null
@cloudRoutine
cloudRoutine / README.md
Created December 15, 2021 01:28 — forked from mrange/README.md
# F# Advent 2021 Dec 08 - Fast data pipelines with F#6

F# Advent 2021 Dec 08 - Fast data pipelines with F#6

Thanks to Sergey Tihon for running F# Weekly and F# Advent.

Thanks to manofstick for trying out the code and coming with invaluable feedback. Cistern.ValueLinq is very impressive.

TLDR; F#6 enables data pipelines with up to 15x less overhead than LINQ

There were many interesting improvements in F#6 but one in particular caught my eye, the attribute InlineIfLambda.

@cloudRoutine
cloudRoutine / booyer-moore_knuth-morris-pratt.fs
Last active April 23, 2021 19:55
String Search Algorithms ( Boyer-Moore & Knuth-Morris-Pratt )
module StringMatching =
open System
/// Knuth-Morris-Pratt String Searching Algorithm ///
let kmp_search (text:string) (word:string) : int =
let kmp_table (word:string) =
let table = [| 1..word.Length |]
table.[0] <- -1
@cloudRoutine
cloudRoutine / fsharp_advent_2016_12_10.md
Created December 18, 2018 10:31 — forked from mrange/fsharp_advent_2016_12_10.md
F# Advent 2016 (English) - December 10 - Implementing a persistent hash map.
@cloudRoutine
cloudRoutine / msbuild-xaml.md
Last active July 24, 2017 21:10
MSBUILD XAML Reference
@cloudRoutine
cloudRoutine / optimizing_performance.md
Created October 12, 2016 07:09 — forked from mrange/optimizing_performance.md
Optimizing a simple problem in F# and C++

Optimizing a simple problem

I was introduced to a simple optimization problem by one of my interns last week. He was about to participate in a friendly competition where they were asked to find a performant solution to the problem:

The problem

@cloudRoutine
cloudRoutine / logo_turtle.fsx
Created August 7, 2016 09:24
Logo Turtle Computation Expression
namespace CExprs
module LogoTurtle =
type Distance_Unit = STEPS
type Rotation_Unit = GRADATIONS
type Rotation_Direction = | LEFT | RIGHT
let STEP = STEPS
let GRADATION = GRADATIONS