Fix to variant name creation for dependencies.

Last few changes to go Tuple Index,
Assert, Check, not

change test 35 to produce intended functionality
This commit is contained in:
Kasey White
2022-12-30 03:29:26 -05:00
committed by Lucas
parent b0ea187151
commit 3514e66234
4 changed files with 79 additions and 32 deletions

View File

@@ -4,6 +4,10 @@ pub opaque type Dict<key, value> {
inner: List<#(ByteArray, value)>,
}
pub fn toList(self: Dict<ByteArray, value>){
self.inner
}
/// Create a new map
pub fn new() -> Dict<key, value> {
Dict { inner: [] }

View File

@@ -30,8 +30,7 @@ pub fn add(left v0: Value, right v1: Value) -> Value {
v0,
v1,
fn(_, a0, a1) {
Some(
dict.union_with(
let asset = dict.union_with(
a0,
a1,
fn(_, q0, q1) {
@@ -42,8 +41,12 @@ pub fn add(left v0: Value, right v1: Value) -> Value {
Some(q)
}
},
))
)
when dict.toList(asset) is {
[] -> None
_ -> Some(asset)
}
},
)
}