def parse.scheme
import emerging-ezhttp@0.21.0.0/src/url.bend as Urlimport Base
147# a url split on its colons: the first piece is the scheme, and a colon in the
148# path survives because the rest is joined back up
149def parse.scheme(ps: List<&2, String>) -> Loc:
150 match ps:
151 case []:
152 Bad{"an empty url"}
153 case h <> t:
154 parse.rest(String.to_lower(h), String.join(t, ":"))