Skip to content

Instantly share code, notes, and snippets.

View CoditCompany's full-sized avatar
👋
You can find us on @CoditEU

Codit CoditCompany

👋
You can find us on @CoditEU
View GitHub Profile
let chop ints str =
let values xs str =
let head = 0, List.head xs
let middle = List.pairwise xs
let tail = List.last xs, String.length str
head :: middle @ [tail]
let chars = [ for c in str -> c ]
let chunk (skip, take) = List.take take chars |> List.skip skip
let trim (x : string) = x.Trim ()
let datetime y m d = new DateTime (y, m, d)
let string' (cs : char list) : string = System.String.Join(System.String.Empty, cs |> List.toArray)
let string_int = string' >> int
let PO = pstring "PO"
let dash = pstring "-"
let countDigit n = count n digit |>> string_int
let year_dash = countDigit 4 .>> dash
let day = count 2 digit |>> string_int
let month_dash = month .>> dash
let month = count 2 digit |>> string_int
let year_dash = year .>> dash
let dash = pstring "-"
let string' (cs : char list) : string = String.Join(String.Empty, cs |> List.toArray)
let string_int = string' >> int
let year = count 4 digit |>> string_int
let PO = pstring "PO"