diff options
Diffstat (limited to 'dhall/src/simple.rs')
-rw-r--r-- | dhall/src/simple.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/dhall/src/simple.rs b/dhall/src/simple.rs index 9d3846e..014053e 100644 --- a/dhall/src/simple.rs +++ b/dhall/src/simple.rs @@ -1,7 +1,7 @@ use std::collections::BTreeMap; use crate::syntax::{Builtin, LitKind}; -use crate::Normalized; +use crate::{Normalized, Value}; #[derive(Debug, Clone, PartialEq, Eq)] pub struct SimpleValue { @@ -56,7 +56,10 @@ impl SimpleType { pub fn kind(&self) -> &STyKind { self.kind.as_ref() } - pub fn into_normalized(self) -> Normalized { + pub fn to_value(&self) -> Value { + self.clone().into_normalized().to_value() + } + fn into_normalized(self) -> Normalized { match *self.kind { STyKind::Bool => Normalized::make_builtin_type(Builtin::Bool), STyKind::Natural => Normalized::make_builtin_type(Builtin::Natural), |