Skip to content

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

Closed
@hllizi

Description

@hllizi

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions