From 853807b68a8ec8928a4d497fc7ce2b3676036eed Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 5 Feb 2020 18:33:18 +0000 Subject: Normalize toMap --- dhall/src/semantics/nze/value.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dhall/src/semantics/nze/value.rs') diff --git a/dhall/src/semantics/nze/value.rs b/dhall/src/semantics/nze/value.rs index 1143781..607aa0d 100644 --- a/dhall/src/semantics/nze/value.rs +++ b/dhall/src/semantics/nze/value.rs @@ -167,6 +167,12 @@ impl Value { typecheck(&type_of_builtin(b)).unwrap().eval_closed_expr(), ) } + pub(crate) fn from_text(txt: impl ToString) -> Self { + Value::from_kind_and_type( + ValueKind::TextLit(TextLit::from_text(txt.to_string())), + Value::from_builtin(Builtin::Text), + ) + } pub(crate) fn as_const(&self) -> Option { match &*self.kind() { -- cgit v1.2.3