summaryrefslogtreecommitdiff
path: root/dhall/src
diff options
context:
space:
mode:
Diffstat (limited to 'dhall/src')
-rw-r--r--dhall/src/binary.rs4
-rw-r--r--dhall/src/typecheck.rs10
2 files changed, 7 insertions, 7 deletions
diff --git a/dhall/src/binary.rs b/dhall/src/binary.rs
index 1ab7956..9099afc 100644
--- a/dhall/src/binary.rs
+++ b/dhall/src/binary.rs
@@ -129,7 +129,7 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result<ParsedExpr, DecodeError> {
}
[U64(7), Object(map)] => {
let map = cbor_map_to_dhall_map(map)?;
- Record(map)
+ RecordType(map)
}
[U64(8), Object(map)] => {
let map = cbor_map_to_dhall_map(map)?;
@@ -142,7 +142,7 @@ fn cbor_value_to_dhall(data: &cbor::Value) -> Result<ParsedExpr, DecodeError> {
}
[U64(11), Object(map)] => {
let map = cbor_map_to_dhall_map(map)?;
- Union(map)
+ UnionType(map)
}
[U64(12), String(l), x, Object(map)] => {
let map = cbor_map_to_dhall_map(map)?;
diff --git a/dhall/src/typecheck.rs b/dhall/src/typecheck.rs
index 62dda08..15fb344 100644
--- a/dhall/src/typecheck.rs
+++ b/dhall/src/typecheck.rs
@@ -90,7 +90,7 @@ where
.zip(aR.iter())
.all(|(aL, aR)| go(ctx, aL.as_ref(), aR.as_ref()))
}
- (&Record(ref ktsL0), &Record(ref ktsR0)) => {
+ (&RecordType(ref ktsL0), &RecordType(ref ktsR0)) => {
ktsL0.len() == ktsR0.len()
&& ktsL0.iter().zip(ktsR0.iter()).all(
|((kL, tL), (kR, tR))| {
@@ -98,7 +98,7 @@ where
},
)
}
- (&Union(ref ktsL0), &Union(ref ktsR0)) => {
+ (&UnionType(ref ktsL0), &UnionType(ref ktsR0)) => {
ktsL0.len() == ktsR0.len()
&& ktsL0.iter().zip(ktsR0.iter()).all(
|((kL, tL), (kR, tR))| {
@@ -397,7 +397,7 @@ where
}
return Ok(dhall_expr!(Optional t));
}
- Record(kts) => {
+ RecordType(kts) => {
for (k, t) in kts {
let s = normalized_type_with(ctx, t.clone())?;
ensure_is_type(s, InvalidFieldType(k.clone(), t.clone()))?;
@@ -414,12 +414,12 @@ where
Ok((k.clone(), t))
})
.collect::<Result<_, _>>()?;
- Ok(Record(kts))
+ Ok(RecordType(kts))
}
Field(r, x) => {
let t = normalized_type_with(ctx, r.clone())?;
match t.as_ref() {
- Record(kts) => {
+ RecordType(kts) => {
return kts.get(x).cloned().ok_or_else(|| {
mkerr(MissingField(x.clone(), t.clone()))
})