Skip to content

Automated packaging (dhall package) #1645

@SiriusStarr

Description

@SiriusStarr

I was going to write a script to do this, but thinking about it, I'm wondering if it should be included in dhall-haskell.

The standard for the prelude (and several community packages it seems) is to have a file in each folder named package.dhall that consists of a record of frozen imports of all files in that folder and subfolders/etc. For the Prelude, at the very least, maintaining this is easy but inconvenient (and leads to a lot of failing builds).

As such, I'm (idly) proposing a new command, dhall package to generate such files. dhall package would be called on a folder, e.g.

Prelude
├── Bool
│   ├── and
│   └── show.dhall
├── Integer
│   ├── toDouble
│   └── toNatural

and generate

Prelude
├── Bool
│   ├── and
│   ├── package.dhall
│   └── show.dhall
├── Integer
│   ├── package.dhall
│   ├── toDouble
│   └── toNatural
├── package.dhall

Behavior:

Files Included: By default, *.dhall[b] and extensionless files. Packaging fails with an error message of any such files fail to typecheck/hash/etc. (e.g. are not valid Dhall files). (Perhaps there should be an ignore flag, so that a non-dhall, extensionless file could be ignored? Or a flag to only consume files with the explicit Dhall extensions?)

Extant package.dhall Files: Any new entries, removed entries, or changed hashes should be logged in the terminal output. Perhaps should ask for confirmation in such cases (with a flag to force)? Alternately, could include a format indicator comment at the start of package.dhall files so-packaged, e.g.

{- Packaged by dhall package vX.XX -}

and automatically overwrite such package.dhalls but abort if there's a package.dhall lacking that (since it was presumably made by hand then).

Anyways, as I said, somewhat idle thought.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions