Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rspeele/fparsec-pipes
A set of operators for FParsec (http://www.quanttec.com/fparsec/) intended to simplify chaining parsers together.
https://github.com/rspeele/fparsec-pipes
combinator compiler-abuse fparsec parsing
Last synced: 3 months ago
JSON representation
A set of operators for FParsec (http://www.quanttec.com/fparsec/) intended to simplify chaining parsers together.
- Host: GitHub
- URL: https://github.com/rspeele/fparsec-pipes
- Owner: rspeele
- License: mit
- Created: 2015-12-11T01:52:36.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T20:03:37.000Z (about 1 year ago)
- Last Synced: 2024-04-30T20:22:03.000Z (9 months ago)
- Topics: combinator, compiler-abuse, fparsec, parsing
- Language: F#
- Size: 250 KB
- Stars: 44
- Watchers: 4
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# FParsec-Pipes
This library is an extension to the FParsec library (http://www.quanttec.com/fparsec/).
Please see the [project page](http://rspeele.github.io/FParsec-Pipes/)
or read the [intro](http://rspeele.github.io/FParsec-Pipes/Intro.html).FParsec-Pipes does not define new parsers.
Instead, its goal is to make it easier and more readable to define your own parsers.## Why should I care? Show me some code I can write with this.
```fsharp
let pdatetime =
let digits (count : int) = %% +.(qty.[count] * digit) -|> (String >> Int32.Parse)
%% +.digits 4 -- '-' -- +.digits 2 -- '-' -- +.digits 2 -- 'T'
-- +.digits 2 -- ':' -- +.digits 2 -- ':' -- +.digits 2
-|> fun yyyy mm dd h m s ->
new DateTime(yyyy, mm, dd, h, m, s)
```