]> Git — Sourcephile - haskell/symantic-parser.git/blob - symantic-parser.cabal
add cabal flag 'dump-core'
[haskell/symantic-parser.git] / symantic-parser.cabal
1 Name: symantic-parser
2 version: 0.0.0.0
3 synopsis: A Staging Parser
4 description:
5 This is an alternative but incomplete implementation of [ParsleyHaskell](https://github.com/J-mie6/ParsleyHaskell).
6 .
7 Main improvements are:
8 .
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.
30 .
31 Goals are:
32 .
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.
39 * To have unit tests.
40 .
41 TODO:
42 .
43 * Eval instructions
44 * Collect subroutines in a big recursive LetE
45 * Inputable instances
46 * Join points
47 * Errors
48 * Registers
49 license: GPL-3
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
56 category: Text
57 extra-source-files:
58 extra-tmp-files:
59 build-type: Simple
60 cabal-version: >=1.10
61 tested-with: GHC==9.0.1
62
63 flag dump-core
64 description: Dump GHC's Core in HTML
65 default: False
66
67 Library
68 hs-source-dirs: src
69 exposed-modules:
70 Symantic.Univariant.Trans
71 Symantic.Univariant.Letable
72 Symantic.Parser
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
86 other-modules:
87 default-extensions:
88 BangPatterns,
89 DataKinds,
90 FlexibleContexts,
91 FlexibleInstances,
92 GADTs,
93 GeneralizedNewtypeDeriving,
94 LambdaCase,
95 MultiParamTypeClasses,
96 NamedFieldPuns,
97 NoImplicitPrelude,
98 RankNTypes,
99 RecordWildCards,
100 ScopedTypeVariables,
101 TypeApplications,
102 TypeFamilies,
103 TypeOperators
104 build-depends:
105 base >=4.10 && <5,
106 array,
107 bytestring,
108 containers,
109 ghc-prim,
110 hashable,
111 parallel,
112 template-haskell >= 2.15,
113 -- template-haskell >= 2.16,
114 text,
115 transformers,
116 unordered-containers
117 default-language: Haskell2010
118 ghc-options:
119 -ddump-splices
120 -ddump-to-file
121 -Wall
122 -Wincomplete-uni-patterns
123 -Wincomplete-record-updates
124
125 Test-Suite symantic-parser-test
126 type: exitcode-stdio-1.0
127 hs-source-dirs: test
128 main-is: Main.hs
129 other-modules:
130 Golden
131 Golden.Grammar
132 -- Golden.Utils
133 -- Golden.Parsers
134 -- HUnit
135 -- QuickCheck
136 default-language: Haskell2010
137 default-extensions:
138 FlexibleContexts
139 LambdaCase
140 NamedFieldPuns
141 NoImplicitPrelude
142 RecordWildCards
143 RankNTypes,
144 ScopedTypeVariables
145 TypeApplications
146 TypeFamilies
147 TypeOperators
148 ViewPatterns
149 ghc-options:
150 -Wall
151 -Wincomplete-uni-patterns
152 -Wincomplete-record-updates
153 -fhide-source-paths
154 -freverse-errors
155 -ddump-splices
156 -ddump-to-file
157 build-depends:
158 symantic-parser,
159 base >= 4.10 && < 5,
160 bytestring >= 0.10,
161 containers >= 0.5,
162 deepseq >= 1.4,
163 directory >= 1.3,
164 filepath >= 1.4,
165 hashable >= 1.2.6,
166 process >= 1.6,
167 strict >= 0.4,
168 tasty >= 0.11,
169 tasty-golden >= 2.3,
170 -- tasty-hunit,
171 template-haskell >= 2.15,
172 temporary >= 1.3,
173 text >= 1.2,
174 -- time >= 1.9,
175 transformers >= 0.4,
176 -- QuickCheck >= 2.0,
177 -- tasty-quickcheck,
178 unix >= 2.7,
179 unordered-containers
180 if flag(dump-core)
181 build-depends: dump-core
182 ghc-options: -fplugin=DumpCore
183
184 -- Executable symantic-parser
185 -- hs-source-dirs: exe
186 -- main-is: Main.hs
187 -- other-modules:
188 -- default-language: Haskell2010
189 -- default-extensions:
190 -- LambdaCase
191 -- NamedFieldPuns
192 -- NoImplicitPrelude
193 -- RecordWildCards
194 -- TypeFamilies
195 -- ViewPatterns
196 -- ghc-options:
197 -- -Wall
198 -- -Wincomplete-uni-patterns
199 -- -Wincomplete-record-updates
200 -- -fhide-source-paths
201 -- -threaded -rtsopts
202 -- -freverse-errors
203 -- build-depends:
204 -- symantic-parser,
205 -- base >= 4.10 && < 5,
206 -- bytestring >= 0.10,
207 -- containers >= 0.5,
208 -- deepseq >= 1.4,
209 -- hashable >= 1.2.6,
210 -- text >= 1.2,
211 -- transformers >= 0.4,
212 -- unordered-containers,
213 -- unix