]> Git — Sourcephile - haskell/symantic-parser.git/blob - symantic-parser.cabal
fix cabal metadata
[haskell/symantic-parser.git] / symantic-parser.cabal
1 Name: symantic-parser
2 version: 0.0.0.0
3 synopsis: Parser combinators staged using Typed Template Haskell.
4 description:
5 This package generate an Haskell parser
6 from tagless-final combinators.
7 .
8 This is an alternative but incomplete implementation of [ParsleyHaskell](https://github.com/J-mie6/ParsleyHaskell).
9 .
10 Main improvements are:
11 .
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.
34 .
35 Goals are:
36 .
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.
43 .
44 TODO:
45 .
46 * Factorize input size checks (Like Parsley's piggy bank).
47 * Error messages also based upon throwing exceptions with labels.
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.16,
113 text,
114 transformers,
115 unordered-containers
116 default-language: Haskell2010
117 ghc-options:
118 -ddump-splices
119 -ddump-to-file
120 -Wall
121 -Wincomplete-uni-patterns
122 -Wincomplete-record-updates
123
124 Test-Suite symantic-parser-test
125 type: exitcode-stdio-1.0
126 hs-source-dirs: test
127 main-is: Main.hs
128 other-modules:
129 Golden
130 Golden.Grammar
131 -- Golden.Utils
132 -- Golden.Parsers
133 -- HUnit
134 -- QuickCheck
135 default-language: Haskell2010
136 default-extensions:
137 FlexibleContexts
138 LambdaCase
139 NamedFieldPuns
140 NoImplicitPrelude
141 RecordWildCards
142 RankNTypes,
143 ScopedTypeVariables
144 TypeApplications
145 TypeFamilies
146 TypeOperators
147 ViewPatterns
148 ghc-options:
149 -Wall
150 -Wincomplete-uni-patterns
151 -Wincomplete-record-updates
152 -fhide-source-paths
153 -freverse-errors
154 -ddump-splices
155 -ddump-to-file
156 build-depends:
157 symantic-parser,
158 base >= 4.10 && < 5,
159 bytestring >= 0.10,
160 containers >= 0.5,
161 deepseq >= 1.4,
162 directory >= 1.3,
163 filepath >= 1.4,
164 hashable >= 1.2.6,
165 process >= 1.6,
166 strict >= 0.4,
167 tasty >= 0.11,
168 tasty-golden >= 2.3,
169 -- tasty-hunit,
170 template-haskell >= 2.16,
171 -- temporary >= 1.3,
172 text >= 1.2,
173 -- time >= 1.9,
174 transformers >= 0.4,
175 -- QuickCheck >= 2.0,
176 -- tasty-quickcheck,
177 unix >= 2.7,
178 unordered-containers
179 if flag(dump-core)
180 build-depends: dump-core
181 ghc-options: -fplugin=DumpCore
182
183 -- Executable symantic-parser
184 -- hs-source-dirs: exe
185 -- main-is: Main.hs
186 -- other-modules:
187 -- default-language: Haskell2010
188 -- default-extensions:
189 -- LambdaCase
190 -- NamedFieldPuns
191 -- NoImplicitPrelude
192 -- RecordWildCards
193 -- TypeFamilies
194 -- ViewPatterns
195 -- ghc-options:
196 -- -Wall
197 -- -Wincomplete-uni-patterns
198 -- -Wincomplete-record-updates
199 -- -fhide-source-paths
200 -- -threaded -rtsopts
201 -- -freverse-errors
202 -- build-depends:
203 -- symantic-parser,
204 -- base >= 4.10 && < 5,
205 -- bytestring >= 0.10,
206 -- containers >= 0.5,
207 -- deepseq >= 1.4,
208 -- hashable >= 1.2.6,
209 -- text >= 1.2,
210 -- transformers >= 0.4,
211 -- unordered-containers,
212 -- unix