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