symantic-base: Commonly useful symantics 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.Typed is for combinators indexed by a single type.

  • Symantic.Dityped is for combinators indexed by an extensible function type, used for typed formatting, enabling type safe dual interpreters à la printf and scanf. Inspired by Oleg Kiselyov's PrintScanF.hs. For an example, see symantic-http.

  • Symantic.{Typed,Dityped}.Lang gather commonly used tagless-final combinators (the syntax part of symantics).

  • Symantic.Typed.Data is an interpreter enabling to pattern-match on combinators, while keeping their extensibility.

  • Symantic.{Typed,Dityped}.Derive enable to give a default value to combinators which avoids boilerplate code when implementing combinators for an interpreter is factorizable.

  • Symantic.Typed.ObserveSharing enables to observe Haskell let definitions, turning infinite values into finite ones, which is useful to inspect and optimize recursive grammars for example. Inspired by Andy Gill's Type-safe observable sharing in Haskell. For an example, see symantic-parser.

  • Symantic.Typed.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.Typed.View is an interpreter enabling to turn combinators into a human-readable string.

  • Symantic.Dityped.ADT enables to define formats à la printf-scanf using data-constructors instead of Eithers of tuples. For an example, see symantic-atom.

  • Symantic.Dityped.CurryN gather utilities for currying or uncurrying tuples of size greater or equal to 2.

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

Downloads

Maintainer's Corner

Package maintainers

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, 0.5.0.20221211
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 Julien Moutinho <julm+symantic-base@sourcephile.fr>
Category Data Structures
Bug tracker https://mails.sourcephile.fr/inbox/symantic-base
Source repo head: git clone git://git.sourcephile.fr/haskell/symantic-base
Uploaded by julm at 2021-07-11T19:54:59Z
Distributions NixOS:0.5.0.20221211
Reverse Dependencies 2 direct, 1 indirect [details]
Downloads 889 total (27 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]