author: Julien Moutinho -- bug-reports: http://doc.autogeree.net/symantic/bugs build-type: Simple cabal-version: >= 1.10 category: Language -- data-dir: data -- data-files: description: Library gathering main ideas from the approach of embedded DSL (Domain-Specific Language) developed by Jacques Carette, Oleg Kiselyov and Chung-chieh Shan, and pursuing their work to make it usable as a non-embedded DSL. . A so-called /symantic/ type class defines a /syntax/ and each of its instances defines a new /semantic/ (computing a Haskell term, serializing, optimizing, …). . Combining the methods of those /symantic/ type classes gives rise to a DSL within which one can write /symantic/ expressions at developing time; but in order to handle such expression when entered by an end-user, one has to be able to construct it at runtime. . This library (including its Test.hs files) demonstrates this for a few usual types and methods, by: . * Parsing a /symantic/ expression from an AST (Abstract Syntax Tree). . * Removing or adding /symantic/ parsers by fully reusing old parsers (i.e. without copying or altering them). . * Interpreting a /symantic/ expression multiple times and with different interpreters without reparsing the expression. . Hence, one can select all or a few expressions (and associated types) of this library, add its own, parse them at runtime from its own AST, and then interpret them at will. . One important drawback of this flexibility is the introduction of a lot of type constraints, so far this hasn't discouraged me… because for this reading the vertically-aligned source code is easier than its Haddock rendition. . Your comments, problem reports, or questions are very welcome! :-) . NOTE: alternative libraries to do more or less the same things include: . extra-source-files: extra-tmp-files: -- homepage: http://pad.autogeree.net/informatique/symantic/ license: GPL-3 license-file: COPYING maintainer: Julien Moutinho name: symantic stability: experimental synopsis: Library for Typed Tagless-Final Higher-Order Extensible DSL tested-with: GHC==7.10.3 version: 1.20161008 Source-Repository head location: git://git.autogeree.net/symantic type: git Flag dev Default: False Description: Turn on development settings. Manual: True Flag dump Default: False Description: Dump some intermediate files. Manual: True Flag prof Default: False Description: Turn on profiling settings. Manual: True Flag threaded Default: False Description: Enable threads. Manual: True Library default-extensions: ghc-options: -Wall -fno-warn-tabs if flag(dev) cpp-options: -DDEVELOPMENT ghc-options: -- -ddump-splices -- -fno-warn-unused-do-bind -fno-warn-name-shadowing -fno-warn-missing-signatures -- -fno-warn-type-defaults -fno-warn-orphans if flag(dump) ghc-options: -ddump-simpl -ddump-stg -ddump-to-file if flag(prof) cpp-options: -DPROFILING ghc-options: -fprof-auto default-language: Haskell2010 exposed-modules: Language.Symantic Language.Symantic.Expr Language.Symantic.Expr.Alt Language.Symantic.Expr.Applicative Language.Symantic.Expr.Bool Language.Symantic.Expr.Either Language.Symantic.Expr.Eq Language.Symantic.Expr.Error Language.Symantic.Expr.From Language.Symantic.Expr.Functor Language.Symantic.Expr.If Language.Symantic.Expr.Int Language.Symantic.Expr.Lambda Language.Symantic.Expr.List Language.Symantic.Expr.Map Language.Symantic.Expr.Maybe Language.Symantic.Expr.Monad Language.Symantic.Expr.Ord Language.Symantic.Expr.Root Language.Symantic.Expr.Traversable Language.Symantic.Expr.Tuple Language.Symantic.Lib.Control.Monad Language.Symantic.Lib.Data.Bool Language.Symantic.Lib.Data.Peano Language.Symantic.Repr Language.Symantic.Repr.Dup Language.Symantic.Repr.Host Language.Symantic.Repr.Text Language.Symantic.Trans Language.Symantic.Trans.Bool Language.Symantic.Trans.Bool.Const Language.Symantic.Trans.Common Language.Symantic.Type Language.Symantic.Type.Alt Language.Symantic.Type.Bool Language.Symantic.Type.Either Language.Symantic.Type.Error Language.Symantic.Type.Fun Language.Symantic.Type.Int Language.Symantic.Type.List Language.Symantic.Type.Map Language.Symantic.Type.Maybe Language.Symantic.Type.Ordering Language.Symantic.Type.Root Language.Symantic.Type.Tuple Language.Symantic.Type.Type0 Language.Symantic.Type.Type1 Language.Symantic.Type.Type2 Language.Symantic.Type.Unit Language.Symantic.Type.Var build-depends: base >= 4.6 && < 5 , containers , ghc-prim -- , monad-classes >= 0.3.1.1 , transformers , text Test-Suite symantic-test type: exitcode-stdio-1.0 default-extensions: OverloadedStrings default-language: Haskell2010 ghc-options: -Wall -fno-warn-tabs -main-is Test hs-source-dirs: Language/Symantic main-is: Test.hs other-modules: AST.Test Expr.Bool.Test Expr.Eq.Test Expr.Functor.Test Expr.If.Test Expr.Int.Test Expr.Lambda.Test Expr.List.Test Expr.Maybe.Test Expr.Test Repr.Host.Test Repr.Test Repr.Text.Test Trans.Bool.Const.Test Trans.Bool.Test Trans.Test Type.Test if flag(threaded) ghc-options: -threaded -rtsopts -with-rtsopts=-N if flag(dev) cpp-options: -DDEVELOPMENT ghc-options: if flag(prof) cpp-options: -DPROFILING ghc-options: -fprof-auto build-depends: base >= 4.6 && < 5 , transformers , tasty >= 0.11 , tasty-hunit , text , symantic