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

Closed
hllizi opened this issue Jun 26, 2024 · 1 comment · Fixed by #2609
Closed

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

hllizi opened this issue Jun 26, 2024 · 1 comment · Fixed by #2609

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?

@Gabriella439
Copy link
Collaborator

Definitely a bug. Fix is up here: #2609

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

Successfully merging a pull request may close this issue.

2 participants