dhall-lang / dhall-haskell

Maintainable configuration files
https://dhall-lang.org/
BSD 3-Clause "New" or "Revised" License
908 stars 211 forks source link

Report imports #2575

Open bgohla opened 3 months ago

bgohla commented 3 months ago

Is there a way for Dhall to report which files are imported?

This would be very handy when writing Makefiles.

E.g.,

dhall imports <<< "{ foo = ./bar.dhall, baz = ./words.txt as Text, boom = https://example.com/package/dhall }"

should answer with

./bar.dhall
./words.txt
Gabriella439 commented 2 months ago

Sorry, for the late reply, but there is a way to do this! The dhall resolve subcommand has a few flags related to this and the one you're probably interested in is --immediate-dependencies:

$ dhall resolve --immediate-dependencies <<< "{ foo = ./bar.dhall, baz = ./words.txt as Text, boom = https://example.com/package/dhall }"
./bar.dhall
./words.txt as Text
https://example.com/package/dhall