This file contains hidden or 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
| let add4 a b c d = a + b + c + d | |
| let pid = pipe4 (pstring "ITEM") (countString 3 digit) (pstring "-") (countString 2 caps) add4 |
This file contains hidden or 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
| let sentence = manyChars (letter <|> space) | |
| let pdes = sentence | |
| let pnotes = sentence |
This file contains hidden or 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
| let pquantity = pint32 | |
| let punitprice = pfloat |
This file contains hidden or 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
| let pcustomers = sepBy1 pcustomer newline |>> List.tryHead |
This file contains hidden or 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
| let pcustomers = sepBy1 pcustomer newline |
This file contains hidden or 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
| let pipe6 p1 p2 p3 p4 p5 p6 f = | |
| pipe5 p1 p2 p3 p4 (tuple2 p5 p6) | |
| (fun x1 x2 x3 x4 (x5, x6) -> f x1 x2 x3 x4 x5 x6) |
This file contains hidden or 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 Customer = | |
| { Country : string | |
| FullName : string | |
| Street : string | |
| City : string | |
| State : string | |
| PostalCode : string } | |
| let customer country name street city state postal = | |
| { Country = country; FullName = name; Street = street ; State = state; City = city; PostalCode = postal } |
This file contains hidden or 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
| let country = countString 10 (caps <|> space) | |
| let fullname = countString 20 (letter <|> space) | |
| let street = countString 20 (letter <|> space <|> digit) | |
| let city = countString 15 (letter <|> space) | |
| let state = countString 3 (caps <|> space) | |
| let postal = countString 5 (caps <|> digit <|> space) |
This file contains hidden or 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
| let trim (s : string) = s.Trim () | |
| let countString n p = count n p |>> (string' >> trim) |
This file contains hidden or 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
| let space = pchar ' ' | |
| let caps = anyOf [ 'A'..'Z' ] |