{"repo":"Holmusk/elm-street","free":true,"listed":false,"github":"https://github.com/Holmusk/elm-street","clone":"git clone https://github.com/Holmusk/elm-street.git","description":":deciduous_tree: Crossing the road between Haskell and Elm","language":"Haskell","stars":92,"topics":["haskell","elm","code-generation","web","backend","frontend"],"license":"MPL-2.0","category":"dev-tools","readme_excerpt":"elm-street Crossing the road between Haskell and Elm. What is this library about? elm-street allows you to automatically generate definitions of Elm data types and compatible JSON encoders and decoders from Haskell types. This helps to avoid writing and maintaining huge chunk of boilerplate code when developing full-stack applications. Getting started In order to use elm-street features, you need to perform the following steps: 1. Add elm-street to the dependencies of your Haskell package. 2. Derive the Elm typeclass for relevant data types. You also need to derive JSON instances according to elm-street naming scheme. This can be done like this: NOTE: This requires extensions -XDerivingStrategies , -XDeriveGeneric , -XDeriveAnyClass . Alternatively you can use -XDerivingVia to remove some boilerplate (available since GHC 8.6.1): 3. Create list of all types you want to expose to Elm: NOTE: This requires extension -XDataKinds . 4. Use generateElm function to output definitions to specified directory under specified module prefix. NOTE: This requires extension -XTypeApplications . When executed, the above program generates the following files: + frontend/src/Core/Generated/Types.elm : Core.Generated.Types module with the definitions for the types, as well as show , read , un , and universe functions as specified in src/Elm/Print/Types.hs + frontend/src/Core/Generated/Encoder.elm : Core.Generated.Encoder module with the JSON encoders for the types + frontend/src/Core/Generated/De","default_branch":null,"files":null,"tree":[],"storefront":"/r/Holmusk","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Holmusk/elm-street/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}