1 author: Julien Moutinho <julm+symantic@autogeree.net>
2 -- bug-reports: http://doc.autogeree.net/symantic/bugs
9 Library gathering main ideas from the
10 <http://okmij.org/ftp/tagless-final/ Tagless-Final>
11 approach of embedded DSL (Domain-Specific Language)
12 developed by Jacques Carette, Oleg Kiselyov and Chung-chieh Shan,
13 and pursuing their work to make it usable as a non-embedded DSL.
15 A so-called /symantic/ type class defines a /syntax/
16 and each of its instances defines a new /semantic/
17 (computing a Haskell term, serializing, optimizing, …).
19 Combining the methods of those /symantic/ type classes
20 gives rise to a DSL within which one can
21 write /symantic/ expressions at developing time;
22 but in order to handle such expression when entered by an end-user,
23 one has to be able to construct it at runtime.
25 This library (including its Test.hs files) demonstrates this
26 for a few usual types and methods, by:
28 * Parsing a /symantic/ expression
29 from an AST (Abstract Syntax Tree).
31 * Removing or adding /symantic/ parsers
32 by fully reusing old parsers
33 (i.e. without copying or altering them).
35 * Interpreting a /symantic/ expression
36 multiple times and with different interpreters
37 without reparsing the expression.
39 Hence, one can select all or a few expressions (and associated types)
40 of this library, add its own, parse them at runtime from its own AST,
41 and then interpret them at will.
43 One important drawback of this flexibility
44 is the introduction of a lot of type constraints;
45 those may be more readable directly in the source code
46 than in its Haddock rendition.
48 Your comments, problem reports, or questions are very welcome! :-)
50 NOTE: alternative libraries to do more or less the same things
51 include: <https://hackage.haskell.org/package/syntactic syntactic>.
54 -- homepage: http://pad.autogeree.net/informatique/symantic/
57 maintainer: Julien Moutinho <julm+symantic@autogeree.net>
59 stability: experimental
60 synopsis: Library for Typed Tagless-Final Higher-Order Extensible DSL
61 tested-with: GHC==7.10.3
64 Source-Repository head
65 location: git://git.autogeree.net/symantic
70 Description: Turn on development settings.
75 Description: Dump some intermediate files.
80 Description: Turn on profiling settings.
85 Description: Enable threads.
90 ghc-options: -Wall -fno-warn-tabs
92 cpp-options: -DDEVELOPMENT
95 -- -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures
96 -- -fno-warn-type-defaults -fno-warn-orphans
98 ghc-options: -ddump-simpl -ddump-stg -ddump-to-file
100 cpp-options: -DPROFILING
101 ghc-options: -fprof-auto
102 default-language: Haskell2010
105 Language.Symantic.Expr
106 Language.Symantic.Expr.Alt
107 Language.Symantic.Expr.Applicative
108 Language.Symantic.Expr.Bool
109 Language.Symantic.Expr.Either
110 Language.Symantic.Expr.Eq
111 Language.Symantic.Expr.Error
112 Language.Symantic.Expr.Foldable
113 Language.Symantic.Expr.From
114 Language.Symantic.Expr.Functor
115 Language.Symantic.Expr.If
116 Language.Symantic.Expr.Int
117 Language.Symantic.Expr.IO
118 Language.Symantic.Expr.Lambda
119 Language.Symantic.Expr.List
120 Language.Symantic.Expr.Map
121 Language.Symantic.Expr.Maybe
122 Language.Symantic.Expr.Monad
123 Language.Symantic.Expr.Monoid
124 Language.Symantic.Expr.Ord
125 Language.Symantic.Expr.Root
126 Language.Symantic.Expr.Text
127 Language.Symantic.Expr.Traversable
128 Language.Symantic.Expr.Tuple
129 Language.Symantic.Lib.Control.Monad
130 Language.Symantic.Lib.Data.Bool
131 Language.Symantic.Lib.Data.Peano
132 Language.Symantic.Repr
133 Language.Symantic.Repr.Dup
134 Language.Symantic.Repr.Host
135 Language.Symantic.Repr.Text
136 Language.Symantic.Trans
137 Language.Symantic.Trans.Bool
138 Language.Symantic.Trans.Bool.Const
139 Language.Symantic.Trans.Common
140 Language.Symantic.Type
141 Language.Symantic.Type.Alt
142 Language.Symantic.Type.Bool
143 Language.Symantic.Type.Either
144 Language.Symantic.Type.Error
145 Language.Symantic.Type.Fun
146 Language.Symantic.Type.Int
147 Language.Symantic.Type.IO
148 Language.Symantic.Type.List
149 Language.Symantic.Type.Map
150 Language.Symantic.Type.Maybe
151 Language.Symantic.Type.Ordering
152 Language.Symantic.Type.Root
153 Language.Symantic.Type.Text
154 Language.Symantic.Type.Tuple
155 Language.Symantic.Type.Type0
156 Language.Symantic.Type.Type1
157 Language.Symantic.Type.Type2
158 Language.Symantic.Type.Unit
159 Language.Symantic.Type.Var
167 Test-Suite symantic-test
168 type: exitcode-stdio-1.0
171 default-language: Haskell2010
172 ghc-options: -Wall -fno-warn-tabs
174 hs-source-dirs: Language/Symantic
178 Expr.Applicative.Test
191 Expr.Traversable.Test
195 Trans.Bool.Const.Test
200 ghc-options: -threaded -rtsopts -with-rtsopts=-N
202 cpp-options: -DDEVELOPMENT
205 cpp-options: -DPROFILING
206 ghc-options: -fprof-auto