@hackage purescript-bridge0.3.1.1
Generate PureScript data types from Haskell data types
Categories
License
AGPL-3.0-only
Maintainer
robert.klotzner@gmx.at
Links
Versions
Installation
Dependencies (6)
- base >=4.8 && <4.9
- containers
- directory
- filepath
- generic-deriving
- text Show all…
Dependents (2)
@hackage/servant-subscriber, @hackage/servant-purescript
purescript-bridge
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".
For compatible JSON representations you should be using aeson's generic encoding/decoding with default options
and gAesonEncodeJson and gAesonDecodeJson from the purescript-argonaut-codecs
package, (Data.Argonaut.Aeson).
At the time of this writing the PR providing Data.Argonaut.Aeson was not yet merged.
In the meantime, you can find the PR
here.
Usage of this library is documented in Language.Purescript.Bridge.
All you should need to get started is: writePSTypes.
You can customize data type translation by providing your own TypeBridge.
This library is at a really early stage. It works for my use case at the moment and I will fix bugs when they come along.
Expect bugs - especially for more advanced use cases!