dhall

What is the dhall idiomatic way to associate different schemas to union values?

我只是一个虾纸丫 提交于 2020-01-16 08:59:26
问题 I'm trying to represent the pipeline system of the Zuul-CI project using Dhall types: a pipeline can use different connections with different trigger events. I'd like to provide a default pipeline that setups the correct trigger event for each type of connections in such a way that: ⊢ RenderPipeline CheckPipeline::{ connections = [ ConnectionTypes.GitHub ] } - pipeline: name: check trigger: github: action: open event: pull-request ⊢ RenderPipeline CheckPipeline::{ connections = [

How do I represent a tuple in dhall?

╄→尐↘猪︶ㄣ 提交于 2020-01-02 01:36:06
问题 I would like to represent IPv4 addresses in dhall, so I can manage my host configurations. By default, this is held as Text; but that's clearly unsatisfactory as it allows any old text to slip through. I would like to keep these values as a 4-tuple of 8-bit values. I don't think that Dhall can allow this natively - the nearest I can see is a record of { a : Natural, b : Natural }, etc., but that's syntactically clunky and still allows for octet values outside of 0-255. Assuming that I can't

How do I represent a tuple in dhall?

筅森魡賤 提交于 2019-12-05 01:30:02
I would like to represent IPv4 addresses in dhall, so I can manage my host configurations. By default, this is held as Text; but that's clearly unsatisfactory as it allows any old text to slip through. I would like to keep these values as a 4-tuple of 8-bit values. I don't think that Dhall can allow this natively - the nearest I can see is a record of { a : Natural, b : Natural }, etc., but that's syntactically clunky and still allows for octet values outside of 0-255. Assuming that I can't achieve this directly in Dhall, perhaps I can define a type in Haskell that can automatically read