Derive Elm type definitions and JSON encoders/decoders from Haskell types for seamless full-stack development.
Elm Bridge is a Haskell library that automatically generates Elm type definitions and JSON serialization/deserialization code from Haskell data types. It solves the problem of maintaining consistent data structures between a Haskell backend and an Elm frontend by automating the translation process, reducing manual errors and boilerplate code.
Full-stack developers working with Haskell backends and Elm frontends who need to share complex data types across both layers efficiently and safely.
Developers choose Elm Bridge because it guarantees type consistency between Haskell and Elm, eliminates repetitive manual coding for serialization, and integrates seamlessly with existing Haskell projects using simple Template Haskell directives.
Haskell: Derive Elm types from Haskell types
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses Template Haskell to generate Elm type aliases and JSON encoders/decoders directly from Haskell data types, eliminating manual translation as shown in the usage example with deriveBoth.
Ensures data structures match exactly between Haskell and Elm, preventing serialization mismatches and errors in full-stack applications.
Allows configuration through options to tailor Elm module structure and naming, though the README primarily demonstrates defaultOptions for simplicity.
Includes helper functions like stringSerForSimpleAdt to handle algebraic data types not using JSON, extending usability beyond standard JSON serialization.
Generated Elm modules require the bartavelle/json-helpers package, adding an external dependency that must be managed separately in the Elm project, as noted in the README.
Specifically designed for Elm 0.19, with legacy support for older versions through separate releases, which complicates upgrades and version management.
Relies on Template Haskell, which can increase compilation time and may not be compatible with all Haskell build setups or teams preferring explicit code generation.