example.bend source
example.bend on the hub 路 documented module
import Baseimport ./main.bend as Simport ./types.bend as Tdef display_result(r: Result<T.Error,String>) -> String: match r: case Fail{e}: "unexpected extraction error" case Done{slice}: slicedef extracted(pair: S.Source & Result<T.Error,String>) -> String: (s,r) = pair display_result(r)def built(r: Result<T.Error,S.Source>) -> String: match r: case Fail{e}: "unexpected construction error" case Done{s}: extracted(S.Source.extract(s,T.Span{42,1,2}))def main() -> String: built(S.Source.new(42,"a馃榾\n尾"))