def fits
import bend-collections@1.0.0.0/src/math/generic.bend as Genericimport Base
47# x when it fits, else None
48def fits(-T: Data, over: Bool, +x: T) -> Maybe<&2, T>:
49 match over:
50 case True{}:
51 None{}
52 case False{}:
53 Some{x}