symantic-base: Basic symantic combinators for Embedded Domain-Specific Languages (EDSL)

[ agpl, data-structures, library ] [ Propose Tags ]

This is a work-in-progress collection of basic tagless-final combinators, along with some advanced utilities to exploit them. * Symantic.Syntaxes.Classes gathers commonly used tagless-final combinators (the syntax part of symantics). * Symantic.Syntaxes.Data interprets combinators as data constructors enabling to pattern-match on combinators while keeping their extensibility. * Symantic.Syntaxes.Derive to give a default value to combinators which avoids boilerplate code when implementing combinators for an interpreter is factorizable. * Symantic.Syntaxes.EithersOfTuples leverages GHC.Generics to generate reciprocal functions between algebraic data type constructors and Eithers-of-Tuples. * Symantic.Syntaxes.TuplesOfFunctions enables the use of Tuples-of-Functions instead of Eithers-of-Tuples. * Symantic.Syntaxes.CurryN gathers utilities for currying or uncurrying tuples of size greater or equal to two. * Symantic.Semantics.SharingObserver interprets combinators to observe let definitions at the host language level (Haskell), effectively turning infinite values into finite ones, which is useful for example to inspect and optimize recursive grammars. Inspired by Andy Gill's Type-safe observable sharing in Haskell. For an example, see symantic-parser. * Symantic.Semantics.ToFer interprets combinators to return Tuples-of-Functions instead of Eithers-of-Tuples. * Symantic.Semantics.Viewer interprets combinators as human-readable text. * Symantic.Semantics.Viewer.Fixity gathers utilities for parsing or viewing infix, prefix and postfix combinators. * Symantic.Syntaxes.Reader is an intermediate interpreter enabling to change the syntax combinators using an environment. * Symantic.Utils.Reify enables the lifting to any interpreter of any Haskell functions taking as arguments only polymorphic types (possibly constrained) or functions using such types. Inspired by Oleg Kiselyov's TDPE.hs.


Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS],,,,,,,,
Change log
Dependencies base (>=4.10 && <5), containers, hashable, template-haskell, transformers, unordered-containers [details]
License AGPL-3.0-or-later
Copyright Julien Moutinho <>
Author Julien Moutinho <>
Category Data Structures
Home page
Bug tracker
Source repo head: git clone git://
Uploaded by julm at 2023-01-25T00:57:24Z
Distributions NixOS:
Reverse Dependencies 2 direct, 1 indirect [details]
Downloads 913 total (16 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]