SchemaFragments.merge: def of bendvy-ecs-core@0.1.0.3 Import: import bendvy-ecs-core@0.1.0.3/schema_fragments.bend as SchemaFragments Lines 135-140 of bendvy-ecs-core@0.1.0.3/schema_fragments.bend: https://jend.leeeet.dev/read.txt?path=bendvy-ecs-core@0.1.0.3/schema_fragments.bend&start_line=135&end_line=140 import Base # Validate both fragments and their combined entries before combining owners. # Success retains left-then-right entries and (L & R) owners; refusal returns # both original fragments. No initializer or gameplay callback is invoked. def merge(~S: Data,~L: Type,~R: Type,left: Fragment,right: Fragment) -> Merge: match left right: case Fragment{+le,l} Fragment{+re,r}: merge_checked(~S,~L,~R,first_failure(validate(~S,le),first_failure(validate(~S,re),validate(~S,List.append(&2,Entry,le,re)))),List.append(&2,Entry,le,re),Fragment{le,l},Fragment{re,r}) Uses (7): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List.append https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/schema_fragments.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/schema_fragments.bend&name=Fragment https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/schema_fragments.bend&name=Merge https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/schema_fragments.bend&name=first_failure https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/schema_fragments.bend&name=merge_checked https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.3/schema_fragments.bend&name=validate