Holmusk / elm-street

:deciduous_tree: Crossing the road between Haskell and Elm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overrididing the default source code generation

turboMaCk opened this issue · comments

Currently the only generation hooks are settings of a file path https://hackage.haskell.org/package/elm-street-0.1.0.4/docs/Elm-Generate.html#t:Settings

However this is highly inflexible. We should at least some of

  • provide ability to produce Text/String/Bytestring so it can be post-processed if needed or piped to any file (stdout)
  • make it possible to write the content to file descriptor (though I think above would be enough and better)
  • make it possible to extend default imports with custom imports for each type

This would make it possible to combine elm-street with hand written decoders and type as well as provide an ability to write working Elm which are not implemented by the library itself. Example: #111 This requires extending Types module with import Json.Decode.