purescript-bridge

Generate PureScript data types from Haskell data types

Version on this page:0.13.0.0
LTS Haskell 22.41:0.15.0.0
Stackage Nightly 2024-11-11:0.15.0.0
Latest on Hackage:0.15.0.0

See all snapshots purescript-bridge appears in

BSD-3-Clause licensed by Robert Klotzner
Maintained by robert . klotzner A T gmx . at
This version can be pinned in stack with:purescript-bridge-0.13.0.0@sha256:c2d455a64f2fad7e42866e254528d89bd85ebf99ce85c8e871b6e508b8c7d76d,3219

purescript-bridge

Build Status

Translate your Haskell types to PureScript types. It should in theory work for almost all Haskell types, including type constructors! You just have to instantiate it with dummy parameters from e.g. “Language.PureScript.Bridge.TypeParameters”.

Data type translation is fully and easily customizable by providing your own BridgePart instances!

JSON encoding / decoding

For compatible JSON representations you should be using aeson’s generic encoding/decoding with default options and encodeJson and decodeJson from “Data.Argonaut.Generic.Aeson” in purescript-argonaut-generic-codecs.

Documentation

Usage of this library is documented in Language.Purescript.Bridge, with writePSTypes you should have everything to get started. Documentation can be found here.

Status

It works for my use case and is used in production. PRs for more PSTypes definitions and bridges are very welcome!