I hereby claim:
- I am sillyotter on github.
- I am sillyotter (https://keybase.io/sillyotter) on keybase.
- I have a public key ASALxtcTSUduR1roTJW6rQxjJ6Ej2WQCUivWk6JjhvLkdAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
let damerauLevenshteinDistance (a:string) (b:string) : float = | |
let cost i j = | |
if a.[i] = b.[j] then | |
0.0 | |
else | |
1.0 // replace with querty distance? | |
// below not tail recursive, make it so. else it wont work well on large strings. probably be fine for names though | |
// most people implement this with an array, |
type Message<'S> = | |
| Query of ('S -> unit) | |
| Command of ('S -> 'S) | |
type CQAgent<'S>(state: 'S) = | |
let innerModel = | |
MailboxProcessor<Message<'S>>.Start(fun inbox -> | |
let rec messageLoop (state:'S) = | |
async { | |
let! msg = inbox.Receive() |
((<|) >> (>>) >> ((>>) (|>))) (sprintf "%s %s") "Original." "The";; | |
((>>) >> ((>>) (|>))) (sprintf "%s %s") "Much better." "A slightly neater flip.";; |
open System | |
open System.Security.Cryptography | |
open System.Text | |
open System.Threading | |
let base32alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567" |> Encoding.ASCII.GetBytes | |
let valToChar (b : byte) = base32alphabet.[int (b)] | |
module Seq = | |
let groupsOfAtMost (size : int) = |
open System.Data.SQLite | |
open Dapper | |
type Gender = | |
| Male = 1 | |
| Female = 2 | |
[<CLIMutable>] | |
type thingy = | |
{ Id : int |
public static tB Apply<tA,tB>(this tA a, Func<tA,tB> f) { return f (a); } |
module StateMachine | |
type StateFunction<'a,'b> = | |
| StateFunction of ('a -> 'b -> (StateFunction<'a,'b> * 'b)) | |
| Nothing | |
let private executeState (sf, context) token = | |
match sf with | |
| StateFunction(xf) -> xf token context | |
| Nothing -> Nothing,context |