Automatic Haskell types - Dhall

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sridhar Ratnakumar

makeHaskellTypeFromUnion is awesome.

I only need to write a Types.dhall and use TH to automatically define a Haskell type based on it. One line:

makeHaskellTypeFromUnion "Config" "< Config : ./config/Type.dhall >"

This feature alone beats using some other config parser (like TOML).

I'm happy with it: https://github.com/srid/zulip-archive/commit/16be91e893d5ac67925199ce9bd2c9afc59ad3dd

Zulip Archive viewer (statically generated HTML). Contribute to srid/zulip-archive development by creating an account on GitHub.
Sridhar Ratnakumar

This got improved in dhall. We now have makeHaskellTypes that is less restrictive: https://github.com/dhall-lang/dhall-haskell/pull/1664

Inspired by this discussion: https://discourse.dhall-lang.org/t/makehaskelltypefromunion-and-fields-with-sum-types/150 This adds a new makeHaskellTypes utility which can generate multiple types whi...