Closed austinwarner-8451 closed 1 month ago
Worth considering here, if we are going to do add a Map
type, would it make sense to also add Filter
and Fold
/Reduce
types that recreate the builtin filter
and functools.reduce
?
Had the realization that this "Map" is not fully analogous to the built in map. I think I will rename it to Iterate
.
In terms of filter/reduce, this is something that can be pretty easily accomplished with the .apply
method proposed is #6
Coming in Labrea 2.0, will be named Map
There are situations where evaluating a dataset (or other
Evaluatable
) multiple times with different inputs can be useful. Currently, this is only possible at the top-level, and cannot be expressed within labrea. The proposal is to create aMap
type, that acts like the builtinmap
(or a list comprehension)Maps can be chained together to create nested lists
Or we can map over multiple at once for a flattened list
Similarly to
Map
, there should also be aDictMap
that retains the options used to generate each result. This will require that the keys be hashable. Probably should use frozendict as the keys.