def code
import snap@1.4.0.0/src/answer.bend as Answerimport Base
14# the exit status a run answered with: the answer up to its first newline.
15# It reads no further, so a long body costs nothing.
16def code(out: String) -> String:
17 match out:
18 case SNil{}:
19 SNil{}
20 case SCon{+ch, tail}:
21 code.at(Char.is_eq(ch, '\n'), ch, _u => code(tail))