diff options
author | Nadrieril | 2019-08-19 22:26:17 +0200 |
---|---|---|
committer | Nadrieril | 2019-08-19 22:43:44 +0200 |
commit | 07a276c1d6ee892b93abbd7a73c78c96d56f4fe7 (patch) | |
tree | 1524e5bf80bb05d319764ed5f53bac81cb64df87 /dhall/src/core/valuef.rs | |
parent | 26a1fd0f0861038a76a0f9b09eaef16d808d4139 (diff) |
Reduce untyped construction of Values
Diffstat (limited to 'dhall/src/core/valuef.rs')
-rw-r--r-- | dhall/src/core/valuef.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/dhall/src/core/valuef.rs b/dhall/src/core/valuef.rs index b948eb1..de55d2f 100644 --- a/dhall/src/core/valuef.rs +++ b/dhall/src/core/valuef.rs @@ -48,8 +48,14 @@ pub enum ValueF { } impl ValueF { - pub(crate) fn into_value(self) -> Value { - Value::from_valuef(self) + pub(crate) fn into_value_untyped(self) -> Value { + Value::from_valuef_untyped(self) + } + pub(crate) fn into_value_with_type(self, t: TypedValue) -> Value { + Value::from_valuef_and_type(self, t) + } + pub(crate) fn into_value_simple_type(self) -> Value { + Value::from_valuef_simple_type(self) } /// Convert the value to a fully normalized syntactic expression @@ -258,12 +264,12 @@ impl ValueF { /// Apply to a value pub(crate) fn app_valuef(self, val: ValueF) -> ValueF { - self.app_value(val.into_value()) + self.app_value(val.into_value_untyped()) } /// Apply to a thunk pub fn app_value(self, th: Value) -> ValueF { - Value::from_valuef(self).app_value(th) + Value::from_valuef_untyped(self).app_value(th) } pub fn from_builtin(b: Builtin) -> ValueF { |