about summary refs log tree commit diff
path: root/tvix/eval/src/value/list.rs
diff options
context:
space:
mode:
authorGriffin Smith <grfn@gws.fyi>2022-10-18T10·32-0400
committerclbot <clbot@tvl.fyi>2022-10-24T08·13+0000
commite2f0967d3fd44cac78ac50425bc2dbe65fd4a8c4 (patch)
tree3a025e71afed11681aa19ffb9b57b76b773dc079 /tvix/eval/src/value/list.rs
parentdfa4c4847c2c597300a5ee4fa80a209d2a6453e0 (diff)
feat(nix/eval): Implement builtins.groupBy r/5189
Change-Id: I3e0aa017a7100cbeb86d2e5747471b36affcc102
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7038
Autosubmit: grfn <grfn@gws.fyi>
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/value/list.rs')
-rw-r--r--tvix/eval/src/value/list.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tvix/eval/src/value/list.rs b/tvix/eval/src/value/list.rs
index d13e220bbe64..66f7eb8108e9 100644
--- a/tvix/eval/src/value/list.rs
+++ b/tvix/eval/src/value/list.rs
@@ -49,6 +49,14 @@ mod arbitrary {
 }
 
 impl NixList {
+    pub fn new() -> Self {
+        Self(vec![])
+    }
+
+    pub fn push(&mut self, val: Value) {
+        self.0.push(val)
+    }
+
     pub fn concat(&self, other: &Self) -> Self {
         let mut ret = self.clone();
         ret.0.extend_from_slice(&other.0);