def String.take

Base · base.bend:2133

import Base
2133def String.take(s: String, n: Nat) -> String:
2134  match s n:
2135    case SNil{} _:
2136      SNil{}
2137    case SCon{h, t} 0n:
2138      SNil{}
2139    case SCon{h, t} 1n+p:
2140      SCon{h, String.take(t, p)}

Uses (2)

Used by (93)