url.bend checks
raw source on the hub · import element-rfc3986@0.1.0.0/url.bend as Url
1 import
import Base
Types
type Url source · line 11 · raw
Data
Url@scheme:Maybe<&2, String> -> @auth:Maybe<&2, String> -> @path:String -> @query:Maybe<&2, String> -> @frag:Maybe<&2, String> -> Url
type Cut source · line 22 · raw
Data
Split at the first char in stops: (before, Some(rest from that char)) or
(all, None).
Cut@before:String -> @rest:Maybe<&2, String> -> Cut
Definitions
def rev source · line 17 · raw
@s:String -> String
def is_in source · line 25 · raw
@+c:Char -> @stops:String -> Bool
def none_yet source · line 32 · raw
@m:Maybe<&2, String> -> Bool
def cut_go source · line 40 · raw
@s:String -> @+stops:String -> @+acc:List<&2, Char> -> @+found:Maybe<&2, String> -> Cut
One pass over the whole string; found latches at the first stop char.
def cut source · line 53 · raw
@s:String -> @+stops:String -> Cut
def cut_before source · line 56 · raw
@c:Cut -> String
def cut_rest source · line 61 · raw
@c:Cut -> Maybe<&2, String>
def drop1 source · line 66 · raw
@s:String -> String
def drop_maybe1 source · line 69 · raw
@m:Maybe<&2, String> -> Maybe<&2, String>
def or_empty source · line 76 · raw
@m:Maybe<&2, String> -> String
def is_some source · line 83 · raw
@m:Maybe<&2, String> -> Bool
def is_scheme_char source · line 92 · raw
@+c:Char -> Bool
def all_scheme source · line 95 · raw
@s:String -> Bool
def starts_alpha source · line 102 · raw
@s:String -> Bool
def split_rest source · line 110 · raw
@scheme:Maybe<&2, String> -> @auth:Maybe<&2, String> -> @+s:String -> Url
path ? query # fragment
def after_auth_pick source · line 121 · raw
@has_auth:Bool -> @+s:String -> @scheme:Maybe<&2, String> -> Url
def after_scheme source · line 128 · raw
@scheme:Maybe<&2, String> -> @+s:String -> Url
def scheme_pick source · line 133 · raw
@ok:Bool -> @+c:Cut -> @s:String -> Url
A scheme is the text before the first ':' if that text comes before any '/', '?' or '#' and is a valid scheme name.
def is_colon_cut source · line 140 · raw
@c:Cut -> Bool
def parse source · line 149 · raw
@+s:String -> Url
def opt source · line 155 · raw
@prefix:String -> @m:Maybe<&2, String> -> @suffix:String -> String
def show source · line 162 · raw
@u:Url -> String
def split_segs source · line 173 · raw
@s:String -> @+acc:List<&2, Char> -> @+out:List<&2, String> -> List<&2, String>
def pop source · line 185 · raw
@xs:List<&2, String> -> List<&2, String>
def dots source · line 194 · raw
@segs:List<&2, String> -> @+out:List<&2, String> -> @last_dir:Bool -> List<&2, String>
Walk the input segments. last_dir records that the final input segment
was "." or "..", which leaves a trailing slash.
def join_segs source · line 206 · raw
@xs:List<&2, String> -> @first:Bool -> String
def remove_dots source · line 213 · raw
@+p:String -> String
def merge source · line 221 · raw
@has_auth:Bool -> @+base_path:String -> @+ref_path:String -> String
5.2.3 merge: base with authority and empty path -> "/" ++ ref; else the base path up to its last "/" ++ ref.
def resolve_urls source · line 225 · raw
@+b:Url -> @+r:Url -> Url
def resolve source · line 234 · raw
@base:String -> @ref:String -> String
def url_host source · line 239 · raw
@u:Url -> String
def url_scheme source · line 244 · raw
@u:Url -> String
def port_default source · line 249 · raw
@m:Maybe<&2, U32> -> @+sch:String -> U32
def port_read source · line 256 · raw
@m:Maybe<&2, String> -> @+sch:String -> U32
def port_of source · line 263 · raw
@+auth:String -> @+sch:String -> U32
def url_port source · line 266 · raw
@u:Url -> U32
def url_target source · line 272 · raw
@u:Url -> String
The request target: path (or "/") plus query. The fragment never leaves.
def rfc_base source · line 277 · raw
String