dhall-lang / dhall-json

This repository has moved to https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-json
BSD 3-Clause "New" or "Revised" License
65 stars 6 forks source link

Yaml file validation #1

Closed PierreR closed 7 years ago

PierreR commented 7 years ago

It seems to me I could use the library to do yaml file validation.

Is it something that might be added in the future ?

Gabriella439 commented 7 years ago

It depends on what you mean by YAML file validation. If you mean that you could write the configuration file in Dhall, validate that using a type, and then convert to YAML then you can already do that today.

However, this library doesn't (and probably won't) support converting from YAML to Dhall. The Dhall language and ecosystem tries to avoid importing from other formats and encouraging people to author inputs directly in Dhall so that the whole pipeline is strongly typed from end-to-end.

PierreR commented 7 years ago

I meant the second option not as a complete converter but more as a way to verify expectation while receiving such yaml files.

As you said I realized it is best to use the Dhall format up front. My sole reluctance doing so has been how foreign it might look to other people.

After https://github.com/Gabriel439/Haskell-Dhall-Library/issues/18 I felt more confident it isn't going to surprise readers that much.