MyNixOS website logo
Description

Symantic combinators for deriving clients or a server from an HTTP API.

An extensible, typed and embedded Domain-Specific Language (DSL) to build Web services using a write-an-API-then-derive-code-from-it approach as in servant's, but with term-level combinators instead of type-level combinators.

In this approach, writting an API can be understood like the writing of a printf's or scanf's format: such that deriving a client is like calling printf on both this format and arguments type-checking against the given format, and deriving a server is like calling scanf on both this format and handlers type-checking against the given format.

For learning how to use this library, you can read the demo example in symantic-http-demo.

WARNING: Be aware that this library is young (thus its interface can change without warnings and delays), has no community explicitely committed to support it (thus can die without warning), is poorly tested (thus even less ready for serious work), and — last but not least — is yours as a common for the commons (with the help of its GNU GPLv3 license).

Users of this library can be grateful to the servant's contributors whose work was helpful to have a concrete overview of the functionnalities this library could attain, and thank Oleg Kiselyov whose (once again) mind-blowing (co-)work on typed formatting was helpful to overcome the limitation of one-type-parameter symantics. Indeed the fundamental observation upon which this library is built is that one-type-parameter symantics (repr a) (aka. Tagless-Final typed DSL — basically just a clever use of type classes and instances) can be augmented with an extension type (repr (a -> k) k) extending a function to the right — while forming a category. Which makes term-level combinators able to add arguments to a function within the type they will be instantiated to (repr), such that this library's combinators (that you can extend by just writing a new type class) can be used to write an API instantiable as: a function asking arguments to generate a client's request, or a function asking handlers to generate a server's response, or some documentation type, or any other type for which you can write the type class instances required by the API combinators you use.

Metadata

Version

0.1.1.20190410

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • 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