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.Classes gathers commonly used tagless-final combinators (the syntax part of symantics).

  • Symantic.Data interprets combinators as data constructors enabling to pattern-match on combinators while keeping their extensibility.

  • Symantic.Derive to give a default value to combinators which avoids boilerplate code when implementing combinators for an interpreter is factorizable.

  • Symantic.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.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.

  • Symantic.Viewer interprets combinators as human-readable text.

  • Symantic.ADT enables to derive reciprocal functions between algebraic data type constructors and Eithers of tuples.

  • Symantic.CurryN gathers utilities for currying or uncurrying tuples of size greater or equal to two.

  • Symantic.Fixity gathers utilities for parsing or viewing infix, prefix and postfix combinators.

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.0.20200708, 0.0.1.20200708, 0.0.2.20200708, 0.1.0.20210703, 0.2.0.20210731, 0.2.0.20210831, 0.3.0.20211007, 0.4.0.20211106
Change log ChangeLog.md
Dependencies base (>=4.10 && <5), containers, hashable, template-haskell, transformers, unordered-containers [details]
License AGPL-3.0-or-later
Copyright Julien Moutinho <julm+symantic-base@sourcephile.fr>
Author Julien Moutinho <julm+symantic-base@sourcephile.fr>
Maintainer mailto:~julm/symantic-base@todo.code.sourcephile.fr
Category Data Structures
Home page https://git.code.sourcephile.fr/~julm/symantic-base
Bug tracker https://todo.code.sourcephile.fr/~julm/symantic-base
Source repo head: git clone https://git.code.sourcephile.fr/~julm/symantic-base
Uploaded by julm at 2022-02-12T02:10:54Z
Distributions NixOS:0.4.0.20211106
Downloads 580 total (4 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]