This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |