summaryrefslogtreecommitdiff
path: root/serde_dhall/src
diff options
context:
space:
mode:
authorNadrieril2020-04-06 17:19:31 +0100
committerNadrieril2020-04-06 17:19:31 +0100
commit08e1d8ece4314b56d64fa08595c2e043b97896d1 (patch)
tree22d9fcf951d7e6e86d33e8e1e89465b0e61381c3 /serde_dhall/src
parentd35cb130d80d628807a4247ddf84a8d0230c87ab (diff)
Split off operations from main expr enum
Diffstat (limited to 'serde_dhall/src')
-rw-r--r--serde_dhall/src/value.rs13
1 files changed, 7 insertions, 6 deletions
diff --git a/serde_dhall/src/value.rs b/serde_dhall/src/value.rs
index d6631da..587349c 100644
--- a/serde_dhall/src/value.rs
+++ b/serde_dhall/src/value.rs
@@ -1,7 +1,7 @@
use std::collections::{BTreeMap, HashMap};
use dhall::semantics::{Hir, HirKind, Nir, NirKind};
-use dhall::syntax::{Builtin, Expr, ExprKind, NumKind, Span};
+use dhall::syntax::{Builtin, Expr, ExprKind, NumKind, OpKind, Span};
use crate::{Error, ErrorKind, FromDhall, Result, Sealed};
@@ -218,13 +218,14 @@ impl SimpleType {
SimpleType::Integer => ExprKind::Builtin(Builtin::Integer),
SimpleType::Double => ExprKind::Builtin(Builtin::Double),
SimpleType::Text => ExprKind::Builtin(Builtin::Text),
- SimpleType::Optional(t) => ExprKind::App(
+ SimpleType::Optional(t) => ExprKind::Op(OpKind::App(
hir(ExprKind::Builtin(Builtin::Optional)),
t.to_hir(),
- ),
- SimpleType::List(t) => {
- ExprKind::App(hir(ExprKind::Builtin(Builtin::List)), t.to_hir())
- }
+ )),
+ SimpleType::List(t) => ExprKind::Op(OpKind::App(
+ hir(ExprKind::Builtin(Builtin::List)),
+ t.to_hir(),
+ )),
SimpleType::Record(kts) => ExprKind::RecordType(
kts.iter()
.map(|(k, t)| (k.as_str().into(), t.to_hir()))