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