Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to-directory-tree with Empty Map causes an error #2598

Open
hllizi opened this issue Jun 26, 2024 · 0 comments
Open

to-directory-tree with Empty Map causes an error #2598

hllizi opened this issue Jun 26, 2024 · 0 comments

Comments

@hllizi
Copy link

hllizi commented Jun 26, 2024

Hi everyone.

I've been making increased use of to-directory-tree recently and found that, counter-intuitively, it refuses to turn an empty Map into an empty directory:

dhall to-directory-tree <<< "[] : List {mapKey : Text, mapValue : Text}" --output result

results in:

You tried to translate the following expression to a directory tree:

↳ [] : List { mapKey : Text, mapValue : Text }

... which is not an expression that can be translated to a directory tree.

So whenever I want to generate a directory from a possibly empty Map, I have to turn it into an Optional-valued Map and enclose a dummy object with value None Text, which is rather inconvenient.

This seem like a bug to me. Is there a good reason for this behaviour?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant