Skip to content

Commit 6e2596f

Browse files
committed
builtin: add BoxMap.Bytes
1 parent 3ce07be commit 6e2596f

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/par/builtin/Builtin.par

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ type BoxMap<k, v> = iterative box choice {
384384
}
385385

386386
dec BoxMap.String : [type v] [List<(String) box v>] BoxMap<String, v>
387+
dec BoxMap.Bytes : [type v] [List<(Bytes) box v>] BoxMap<Bytes, v>
387388
dec BoxMap.Int : [type v] [List<(Int) box v>] BoxMap<Int, v>
388389
dec BoxMap.Nat : [type v] [List<(Nat) box v>] BoxMap<Nat, v>
389390

src/par/builtin/boxmap.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ pub fn external_module() -> Module<Arc<process::Expression<()>>> {
3737
),
3838
|handle| Box::pin(boxmap_new(handle, Handle::string, Handle::provide_string)),
3939
),
40+
// BoxMap.Bytes : [type v] [List<(Bytes) box v>] BoxMap<Bytes, v>
41+
Definition::external(
42+
"Bytes",
43+
Type::forall(
44+
"v",
45+
Type::function(
46+
Type::name(
47+
Some("List"),
48+
"List",
49+
vec![Type::pair(Type::bytes(), Type::box_(Type::var("v")))],
50+
),
51+
Type::name(None, "BoxMap", vec![Type::bytes(), Type::var("v")]),
52+
),
53+
),
54+
|handle| Box::pin(boxmap_new(handle, Handle::bytes, Handle::provide_bytes)),
55+
),
4056
// BoxMap.Int : [type v] [List<(Int) box v>] BoxMap<Int, v>
4157
Definition::external(
4258
"Int",

0 commit comments

Comments
 (0)