cabalism / hpack-dhall

Use hpack's phrasing in dhall to write cabal files
BSD 3-Clause "New" or "Revised" License
31 stars 3 forks source link

Add dhall Prelude #33

Closed locallycompact closed 2 years ago

locallycompact commented 2 years ago

Hey, I like this idea and thought it could benefit from a prelude to get some semantics on some of the list elements.

I'm using it like

-- ghc-options.dhall
let Prelude = ./Prelude.dhall

let W = Prelude.GhcWarning.Type

let Yes = Prelude.GhcWarningFlag.Type.Yes

let No = Prelude.GhcWarningFlag.Type.No

in  [ Yes W.Everything
    , No W.AllMissedSpecialisations
    , No W.ImplicitPrelude
    , No W.MissingSafeHaskellMode
    , No W.PrepositiveQualifiedModule
    , No W.Safe
    , No W.Unsafe
    ]
 -- package.dhall
 ...
     , dependencies = Prelude.Prelude.List.map Prelude.Dependency.Type Text Prelude.Dependency.toText ./dependencies.dhall
     , ghc-options = Prelude.Prelude.List.map Prelude.GhcWarningFlag.Type Text Prelude.GhcWarningFlag.toText ./ghc-options.dhall

I used this project as a reference to write the prelude https://github.com/bgamari/dhall-gitlab-ci

locallycompact commented 2 years ago

Ok I didn't realise you could treat adts constructors lowercase and write them out. This changes things.

philderbeast commented 2 years ago

Thanks @locallycompact for the pull request.

philderbeast commented 2 years ago

@locallycompact I've just published hpack-dhall-0.5.3 with a better README. I'm interested in this pull request or its successor.