1 import Base 2 # Generated structural focus/reinsertion: no id-based cast or detached field cache. 3 def take_last(~Left:Type,~Right:Type,owners:Left & Right) -> Left & Right: 4 owners 5 def put_last(~Left:Type,~Right:Type,left:Left,right:Right) -> Left & Right: 6 (left,right) 7 def taken_left(~Previous:Type,~Leaf:Type,~Right:Type,right:Right,result:Previous & Leaf) -> (Previous & Right) & Leaf: 8 match result: 9 case (previous,leaf):((previous,right),leaf) 10 def take_left(~Left:Type,~Previous:Type,~Leaf:Type,~Right:Type,take:Left -> Previous & Leaf,owners:Left & Right) -> (Previous & Right) & Leaf: 11 match owners: 12 case (left,right):taken_left(~Previous,~Leaf,~Right,right,take(left)) 13 def put_left(~Left:Type,~Previous:Type,~Leaf:Type,~Right:Type,put:Previous -> Leaf -> Left,others:Previous & Right,leaf:Leaf) -> Left & Right: 14 match others: 15 case (previous,right):(put(previous,leaf),right) 16 def take_first(~Left:Type,~Leaf:Type,owners:Left & Leaf) -> Left & Leaf: 17 owners 18 def put_first(~Left:Type,~Leaf:Type,left:Left,leaf:Leaf) -> Left & Leaf: 19 (left,leaf)