3 version: 0.0.0.20210101
4 synopsis: Parser combinators staged using Typed Template Haskell
6 This is a work-in-progress experimental library to generate
7 parsers, leveraging Tagless-Final combinators and Typed
10 This is an alternative but less powerful/reviewed
11 implementation of [ParsleyHaskell](https://github.com/J-mie6/ParsleyHaskell).
12 See the paper by Jamie Willis, Nicolas Wu, and Matthew
13 Pickering, admirably well presented at ICFP-2020: [Staged
15 Combinators](https://icfp20.sigplan.org/details/icfp-2020-papers/20/Staged-Selective-Parser-Combinators).
19 * Tagless-final and DefaultSignatures are used
20 instead of tagfull-final to handle recursion schemes,
21 this avoids constructing and deconstructing as much tags when transforming
22 combinators or instructions.
23 And structures/simplifies the code by avoiding to define
24 custom traversals (traverseCombinator)
25 or custom fix-point data-types (Fix4)
26 and associated utilities (cata4) when introducing new index-types.
27 Note that the extensibility of combinators, a great feature of tagless-final,
28 is not really achievable when using the optimizing pass
29 which requires a comprehensive initial encoding.
30 * No dependency on dependant-map by keeping observed sharing
31 inside 'def' and 'ref' combinators, instead of passing by a DependantMap.
32 * No dependency on GHC plugins: lift-plugin and idioms-plugin,
33 because those are plugins hence introduce a bit of complexity
34 in the build process, but most importantly they are experimental
35 and only cosmetic, since they only enable a cleaner usage
36 of the parsing combinators, by lifting Haskell code in 'pure'
37 to integrate the TemplateHaskell needed.
38 I do not understand them (yet) and do not feel confortable
39 to maintain them in case their authors abandon them.
40 * Error messages based upon the farthest input position reached (not yet implemented in Parsley).
41 * License is GPL-3.0-or-later not BSD-3-Clause.
45 * For me to understand ParsleyHaskell, and find a manageable balance
46 between simplicity of the codebase and features of the parser.
47 * To support parsing tree-like data structures (like XML or HTTP routes)
48 instead of just string-like data structures,
49 which is doable with megaparsec, but is hard and less principled
50 when it comes to optimizing, like merging alternatives.
54 * Factorize input size checks (like Parsley's piggy bank).
55 * Error messages also based upon: [A Parsing Machine for Parsing Expression Grammars with Labeled Failures](https://dl.acm.org/doi/10.1145/2851613.2851750)
57 license: GPL-3.0-or-later
58 -- license-file: LICENSE
59 author: Julien Moutinho <julm+symantic-parser@sourcephile.fr>
60 maintainer: Julien Moutinho <julm+symantic-parser@sourcephile.fr>
61 bug-reports: Julien Moutinho <julm+symantic-parser@sourcephile.fr>
62 copyright: Julien Moutinho <julm+symantic-parser@sourcephile.fr>
63 stability: experimental
68 tested-with: GHC==9.0.1
70 source-repository head
72 location: git://git.sourcephile.fr/haskell/symantic-parser
75 description: Dump GHC's Core in HTML
79 default-language: Haskell2010
86 GeneralizedNewtypeDeriving,
88 MultiParamTypeClasses,
99 -Wincomplete-uni-patterns
100 -Wincomplete-record-updates
110 Symantic.Univariant.Letable
111 Symantic.Univariant.Trans
113 Symantic.Parser.Grammar
114 Symantic.Parser.Grammar.Combinators
115 Symantic.Parser.Grammar.Dump
116 Symantic.Parser.Grammar.Fixity
117 Symantic.Parser.Grammar.ObserveSharing
118 Symantic.Parser.Grammar.Optimize
119 Symantic.Parser.Grammar.Write
120 Symantic.Parser.Haskell
121 Symantic.Parser.Machine
122 Symantic.Parser.Machine.Dump
123 Symantic.Parser.Machine.Generate
124 Symantic.Parser.Machine.Input
125 Symantic.Parser.Machine.Instructions
134 template-haskell >= 2.16,
139 test-suite symantic-parser-test
141 type: exitcode-stdio-1.0
168 template-haskell >= 2.16,
173 -- QuickCheck >= 2.0,
178 build-depends: dump-core
179 ghc-options: -fplugin=DumpCore