I hereby claim:
- I am sgoguen on github.
- I am sgoguen (https://keybase.io/sgoguen) on keybase.
- I have a public key ASB7lHbtpeTVKV_POAjX-YXpSjuk3i7VMIMeAKJ0cFCrOgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
open Microsoft.FSharp.Reflection | |
let rec listTypes(t:Type) = | |
[ | |
if FSharpType.IsFunction(t) then | |
let(a,b) = FSharpType.GetFunctionElements(t) | |
yield a | |
if FSharpType.IsFunction(b) then | |
yield! listTypes(b) | |
else |
module TreeMaps | |
type Map<'k,'v> = | |
| Map of ('v -> 'k -> 'v) | |
[<Struct>] | |
type ShallowMap<'k,'v,'c> = | |
| ShallowMap of value:'v * lookup:('k -> 'v -> 'c) |
// 1. Create a project and add Steego.FsPad as a Nuget dependency | |
// 2. Build your project and set this folder to your output | |
#I "bin/Debug/net461/" | |
#r "FSharp.Core.dll" | |
#r "Suave.dll" | |
#r "Steego.FsPad.dll" | |
module Watcher = |
// First, clone the word list project here: https://github.com/dwyl/english-words.git | |
// Then save this file in the same folder and run! | |
open System.IO | |
// Ok... Here's how it works... | |
// First, we load all the words from the Moby text fil | |
let allTheWords = File.ReadAllLines("words.txt") |
let items = [ | |
"1 1/2 cup onions, diced" | |
"1/4 tsp coriander" | |
"1 medium carrot" | |
"1.5 oz olive oil" | |
"two lemons" | |
"mint" | |
] | |
let tokenize(s) = [ for t in Regex.Split(s, "\\b") do |
Full Metal Jacket |
Full Metal Jacket |
/// <summary> | |
/// Builds a map where the keys are word signatures and | |
/// each value is the list of words that share that signature. | |
/// The signature of a word is simply a string containing | |
/// the word's letters, sorted. Thus "dog" and "god" will | |
/// both have the signature "dgo", and the entry in the map | |
/// with that key will be those two words. | |
/// | |
/// This let's us quickly find anagrams | |
/// </summary> |
enum TrustLevel { | |
None, | |
AcceptAllSolutionsTrustLevel | |
} | |
class SomeComponent { | |
private authenticated = false; | |
private isStaff = false; | |
private currentUser = { | |
id: 123, |