Skip to content

Commit

Permalink
feat: Lower collections extension
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-koch committed Nov 26, 2024
1 parent 6a75f4c commit 26d8498
Show file tree
Hide file tree
Showing 18 changed files with 1,055 additions and 1 deletion.
5 changes: 5 additions & 0 deletions hugr-core/src/std_extensions/collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ impl ListValue {
pub fn custom_type(&self) -> CustomType {
list_custom_type(self.1.clone())
}

/// Returns the values contained inside the `[ListValue]`.
pub fn get_contents(&self) -> &Vec<Value> {
&self.0
}
}

impl TryHash for ListValue {
Expand Down
3 changes: 2 additions & 1 deletion hugr-llvm/src/emit/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use hugr_core::ops::handle::FuncID;
use hugr_core::std_extensions::arithmetic::{
conversions, float_ops, float_types, int_ops, int_types,
};
use hugr_core::std_extensions::logic;
use hugr_core::std_extensions::{collections, logic};
use hugr_core::types::TypeRow;
use hugr_core::{Hugr, HugrView};
use inkwell::module::Module;
Expand Down Expand Up @@ -153,6 +153,7 @@ impl SimpleHugrConfig {
float_ops::EXTENSION_ID,
conversions::EXTENSION_ID,
logic::EXTENSION_ID,
collections::EXTENSION_ID,
]),
),
)
Expand Down
1 change: 1 addition & 0 deletions hugr-llvm/src/extension.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod collections;
pub mod conversions;
pub mod float;
pub mod int;
Expand Down
Loading

0 comments on commit 26d8498

Please sign in to comment.