Dhall-lang: Arbitrary string record field identifiers

Created on 4 Jan 2018  路  6Comments  路  Source: dhall-lang/dhall-lang

I'd like to be able to use a wider set of characters to compose record field names. My use case is that I'd like to interface with a system that uses YAML for configuration, and which expects keys that sometimes have colons in them. So for example, I'd like to have...

{ "something::complex" = 123 }

-> dhall-to-yaml ->

something::complex: 123

Yaml allows any arbitrary value as a key (strings, lists, etc...), but for my use case, all I need is to be able to use colons.

Most helpful comment

That sounds reasonable to me. I just created a pull request to amend the standard grammar:

https://github.com/dhall-lang/dhall-lang/pull/65

After a review period of a few days I'll merge that and update the Haskell implementation to match. Once that is done you should be able to use Dhall's support for quoted labels to do what you want, except with backticks instead of quotes:

{ `something::complex` = 123 }

All 6 comments

That sounds reasonable to me. I just created a pull request to amend the standard grammar:

https://github.com/dhall-lang/dhall-lang/pull/65

After a review period of a few days I'll merge that and update the Haskell implementation to match. Once that is done you should be able to use Dhall's support for quoted labels to do what you want, except with backticks instead of quotes:

{ `something::complex` = 123 }

Amazing, thank you!

This works for ::, but not for my|key (using pipe). Also it fails with =, >.

Is this a bug?

Thanks @Profpatsch, that explains it.

@feliksik: Note that this proposed change to the language expands the set of characters for quoted labels to permit |: https://github.com/dhall-lang/dhall-lang/pull/408

So once that is merged and implemented then my|key would be alloewd

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nadrieril picture Nadrieril  路  3Comments

bwestergard picture bwestergard  路  4Comments

MICHAELABICK picture MICHAELABICK  路  5Comments

Nadrieril picture Nadrieril  路  6Comments

philandstuff picture philandstuff  路  4Comments