Closed io12 closed 3 years ago
Thanks for having a go at this! This looks good.
My worry is that a SimpleValue
can't be turned into a Dhall value because it lacks type information. Typically, we'd need to carry a type for the None
case. This might be surprising?
An option is to keep SimpleValue
like this, but ask for a type in order to convert it to dhall. I think that's what I do in my serialization branch.
@rushsteve1 would the PR as proposed work for you?
This should work, especially since @io12 is working on the same project as me.
That said I don't fully understand what you mean when you say "SimpleValue can't be turned into a Dhall type" and the problem with None
cases.
This should work, especially since @io12 is working on the same project as me.
Ok great!
That said I don't fully understand what you mean when you say "SimpleValue can't be turned into a Dhall type" and the problem with
None
cases.
I'm saying we can't write e.g. a function to_dhall_string(x: SimpleValue) -> String
that would print a SimpleValue
into dhall text. That's because given SimpleValue::Optional(None)
, you can't know whether it's a None Natural
, None Bool
, or something else. Same applies to unions: we'd need the whole union type, not just the variant name.
But anyways, I'm happy to merge this as is. We can always add more things later if we need them
Published in 0.7.3!
Fixes https://github.com/Nadrieril/dhall-rust/issues/177.