3 synopsis: Parser combinators staged using Typed Template Haskell.
5 This package generate an Haskell parser
6 from tagless-final combinators.
8 This is an alternative but incomplete implementation of [ParsleyHaskell](https://github.com/J-mie6/ParsleyHaskell).
10 Main improvements are:
12 * Tagless-final and DefaultSignatures are used
13 instead of tagfull-final to handle recursion schemes,
14 this avoids constructing and deconstructing as much tags when transforming
15 combinators or instructions.
16 And structures/simplifies the code by avoiding to define
17 custom traversals (traverseCombinator)
18 or custom fix-point data-types (Fix4)
19 and associated utilities (cata4) when introducing new index-types.
20 Note that the extensibility of combinators, a great feature of tagless-final,
21 is not really achievable when using the optimizing pass
22 which requires a comprehensive initial encoding.
23 * No dependency on dependant-map by keeping observed sharing
24 inside 'def' and 'ref' combinators, instead of passing by a DependantMap.
25 * No dependency on GHC plugins: lift-plugin and idioms-plugin,
26 because those are plugins hence introduce a bit of complexity
27 in the build process, but most importantly they are experimental
28 and only cosmetic, since they only enable a cleaner usage
29 of the parsing combinators, by lifting Haskell code in 'pure'
30 to integrate the TemplateHaskell needed.
31 I do not understand them (yet) and do not feel confortable
32 to maintain them in case their authors abandon them.
33 * Error messages based upon the farthest input position reached.
37 * For me to understand ParsleyHaskell, and find a manageable balance
38 between simplicity of the codebase and features of the parser.
39 * To support parsing tree-like data structures (like XML or HTTP routes)
40 instead of just string-like data structures,
41 which is doable with megaparsec, but is hard and less principled
42 when it comes to optimize, like merging alternatives.
46 * Factorize input size checks (Like Parsley's piggy bank).
47 * Error messages also based upon throwing exceptions with labels.
50 -- license-file: LICENSE
51 author: Julien Moutinho <julm+symantic-parser@sourcephile.fr>
52 maintainer: Julien Moutinho <julm+symantic-parser@sourcephile.fr>
53 bug-reports: Julien Moutinho <julm+symantic-parser@sourcephile.fr>
54 copyright: Julien Moutinho <julm+symantic-parser@sourcephile.fr>
55 stability: experimental
61 tested-with: GHC==9.0.1
64 description: Dump GHC's Core in HTML
70 Symantic.Univariant.Trans
71 Symantic.Univariant.Letable
73 Symantic.Parser.Grammar
74 Symantic.Parser.Grammar.Combinators
75 Symantic.Parser.Grammar.Dump
76 Symantic.Parser.Grammar.Fixity
77 Symantic.Parser.Grammar.ObserveSharing
78 Symantic.Parser.Grammar.Optimize
79 Symantic.Parser.Grammar.Write
80 Symantic.Parser.Machine
81 Symantic.Parser.Machine.Dump
82 Symantic.Parser.Machine.Generate
83 Symantic.Parser.Machine.Input
84 Symantic.Parser.Machine.Instructions
85 Symantic.Parser.Staging
93 GeneralizedNewtypeDeriving,
95 MultiParamTypeClasses,
112 template-haskell >= 2.16,
116 default-language: Haskell2010
121 -Wincomplete-uni-patterns
122 -Wincomplete-record-updates
124 Test-Suite symantic-parser-test
125 type: exitcode-stdio-1.0
135 default-language: Haskell2010
150 -Wincomplete-uni-patterns
151 -Wincomplete-record-updates
170 template-haskell >= 2.16,
175 -- QuickCheck >= 2.0,
180 build-depends: dump-core
181 ghc-options: -fplugin=DumpCore
183 -- Executable symantic-parser
184 -- hs-source-dirs: exe
187 -- default-language: Haskell2010
188 -- default-extensions:
197 -- -Wincomplete-uni-patterns
198 -- -Wincomplete-record-updates
199 -- -fhide-source-paths
200 -- -threaded -rtsopts
204 -- base >= 4.10 && < 5,
205 -- bytestring >= 0.10,
206 -- containers >= 0.5,
208 -- hashable >= 1.2.6,
210 -- transformers >= 0.4,
211 -- unordered-containers,