def is_drop

bend-lint-rules@0.2.0.0 · performance/gpu_fit.bend:61

import bend-lint-rules@0.2.0.0/performance/gpu_fit.bend as GpuFit
import Base
import bend-lint-api@0.2.0.0/linter/lint.bend as Lint

61# Whether a call of `t` (`info`, if the program defines it) only frees its inputs: it returns Unit, as Base's
62# Image.drop, Image.free and Image.sink do.
63def is_drop(info: Maybe<&2, Lint.Def>, t: String) -> Bool:
64  match info:
65    case Some{Lint.Def{d, ps, fs, cs, r}}:
66      String.eq(r, "Unit")
67    case None{}:
68      List.contains(~String, ~String.eq, ["Image.drop", "Image.free", "Image.sink"], t)

Uses (7)

Used by (3)