3 synopsis: A Staging Parser
5 This is an alternative but incomplete implementation of [ParsleyHaskell](https://github.com/J-mie6/ParsleyHaskell).
9 * Tagless-final and DefaultSignatures are used
10 instead of tagfull-final to handle recursion schemes,
11 this avoids constructing and deconstructing tags when transforming
12 combinators or instructions.
13 And structures/simplifies the code by avoiding to define
14 custom traversals (traverseCombinator)
15 or custom fix-point data-types (Fix4)
16 and associated utilities (cata4) when introducing new index-types.
17 Note that the extensibility of combinators, a great feature of tagless-final,
18 is not really achievable when using the optimizing pass
19 which requires a comprehensive initial encoding.
20 * No dependency on dependant-map by keeping observed sharing
21 inside 'def' and 'ref' combinators, instead of passing by a DependantMap.
22 * No dependency on GHC plugins: lift-plugin and idioms-plugin,
23 because those are plugins hence introduce a bit of complexity
24 in the build process, but most importantly they are experimental
25 and only cosmetic, since they only enable a cleaner usage
26 of the parsing combinators, by lifting Haskell code in 'pure'
27 to integrate the TemplateHaskell needed.
28 I do not understand them (yet) and do not feel confortable
29 to maintain them in case their authors abandon them.
33 * For me to understand ParsleyHaskell, and find a manageable balance
34 between simplicity of the codebase and features of the parser.
35 * To support parsing tree-like data structures (like XML or HTTP routes)
36 instead of just string-like data structures,
37 which is doable with megaparsec, but is hard and less principled
38 when it comes to optimize, like merging alternatives.
44 * Collect subroutines in a big recursive LetE
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.15,
113 -- template-haskell >= 2.16,
117 default-language: Haskell2010
122 -Wincomplete-uni-patterns
123 -Wincomplete-record-updates
125 Test-Suite symantic-parser-test
126 type: exitcode-stdio-1.0
136 default-language: Haskell2010
151 -Wincomplete-uni-patterns
152 -Wincomplete-record-updates
171 template-haskell >= 2.15,
176 -- QuickCheck >= 2.0,
181 build-depends: dump-core
182 ghc-options: -fplugin=DumpCore
184 -- Executable symantic-parser
185 -- hs-source-dirs: exe
188 -- default-language: Haskell2010
189 -- default-extensions:
198 -- -Wincomplete-uni-patterns
199 -- -Wincomplete-record-updates
200 -- -fhide-source-paths
201 -- -threaded -rtsopts
205 -- base >= 4.10 && < 5,
206 -- bytestring >= 0.10,
207 -- containers >= 0.5,
209 -- hashable >= 1.2.6,
211 -- transformers >= 0.4,
212 -- unordered-containers,