def insert
bendvy-ecs-core@0.1.0.4 · ordinary_app_access.bend:83
import bendvy-ecs-core@0.1.0.4/ordinary_app_access.bend as OrdinaryAppAccess
import Base
83def insert(+category:Category,+key:String,+uses:List<&2,Use>,entries:List<&2,Entry>) -> List<&2,Entry>:
84 match entries:
85 case []:[Entry{category,key,uses}]
86 case Entry{+other,+otherKey,+otherUses} <> +rest:selected(Bool.and(same_category(category,other),String.eq(key,otherKey)),category,key,uses,other,otherKey,otherUses,rest,_ => insert(category,key,uses,rest))