servant-purescript

Generate PureScript accessor functions for you servant API https://github.com/eskimor/servant-purescript#readme

Version on this page:0.3.1.5
LTS Haskell 15.14:0.9.0.4
Stackage Nightly 2020-05-26:0.10.0.0
Latest on Hackage:0.10.0.0

See all snapshots servant-purescript appears in

BSD-3-Clause licensed by Robert Klotzner
Maintained by robert Dot klotzner A T gmx Dot at

Module documentation for 0.3.1.5

This version can be pinned in stack with:[email protected]:981fcc23f7d2758043a1beddf9cd6f2fb708402a28565171a5efa4b5b5d5fbd3,2278

Servant Purescript

Build Status

Generate typed PureScript query functions for your servant-api. Find an example, including the generated code in examples/central-counter.

Features

  • Typed serialization/deserialization taken care of by Haskell’s aeson and PureScript’s argonaut. Generic encoding/decoding of both made compatible by purescript-argonaut-generic-codecs.
  • You can put common parameters like Auth tokens and the base URL in a reader monad so you don’t have to pass them explicitly. This is configurable in the code generator with readerParams in Settings.

Status

It works!

Documentation is yet to come, but there is a usage example in examples/central-counter which also uses servant-subscriber used for counter live updates. Generated code is only partly tested, especially Query parameters are completely untested.

For type translations purescript-bridge is used.