Skip to content

Instantly share code, notes, and snippets.

View kos59125's full-sized avatar

ABE Kosei kos59125

View GitHub Profile
open System
type Foo = { Field : int }
let random = Random ()
let hasDuplicate keySelector =
let adjacent = Seq.windowed 2 >> Seq.map (function | [| x; y |] -> x, y | _ -> failwith "invalid")
Seq.scan (fun set value -> Set.add (keySelector value) set) Set.empty
>> adjacent
>> Seq.exists (fun (x, y) -> Set.count x = Set.count y)
@kos59125
kos59125 / HttpStatus.fs
Last active December 14, 2015 00:59 — forked from Gab-km/HttpStatus.fs
type HttpStatus =
{ Code: string; Message: string }
override self.ToString () = sprintf "%s %s" self.Code self.Message
let httpStatus code message = { Code = code; Message = message }
let httpStatusList =[
httpStatus "100" "Continue";
httpStatus "101" "Switching Protocols";
httpStatus "102" "Processing";