MyNixOS website logo
Description

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

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.

Metadata

Version

0.5.0.20221211

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows