def atom_of_serial_go
bend-prot@0.1.0.0 · bonded.bend:50
import bend-prot@0.1.0.0/bonded.bend as Bonded
import Base
import bend-prot@0.1.0.0/geom.bend as G
import bend-prot@0.1.0.0/protein.bend as P
50def atom_of_serial_go(xs: List<&2, P.Atom>, +s: U32, best: Maybe<&1, G.Vec3 & U32>) -> Maybe<&1, G.Vec3 & U32>:
51 match xs:
52 case Nil{}:
53 best
54 case h <> t:
55 match h:
56 case P.Atom{serial, elem, +pos}:
57 atom_of_serial_go(t, s, Bool.pick(Maybe<&1, G.Vec3 & U32>, U32.is_eq(serial, s), Some{(pos, elem)}, best))