Module
Payload.Internal.UrlParsing
- Package
- purescript-payload
- Repository
- hoodunit/purescript-payload
#debugShowUrl Source
debugShowUrl :: forall urlStr urlParts. ParseUrl urlStr urlParts => ShowUrl urlParts => Proxy urlStr -> String
#ShowUrl Source
#asSegments Source
asSegments :: forall urlStr urlParts. ParseUrl urlStr urlParts => ToSegments urlParts => Proxy urlStr -> List Segment
#ToSegments Source
class ToSegments (urlParts :: UrlList) where
Members
toSegments :: UrlListProxy urlParts -> List Segment -> List Segment
Instances
ToSegments UrlNil
(IsSymbol key, ToSegments rest) => ToSegments (UrlCons (Key key) rest)
(IsSymbol multi, ToSegments rest) => ToSegments (UrlCons (Multi multi) rest)
(IsSymbol lit, ToSegments rest) => ToSegments (UrlCons (Lit lit) rest)
#UrlNil Source
data UrlNil :: UrlList
Instances
ShowUrl UrlNil
ToSegments UrlNil
Match u "/" "" "" mode UrlNil
Match u "/" "" acc "lit" (UrlCons (Lit acc) UrlNil)
Match u ">" "" acc "multi" (UrlCons (Multi acc) UrlNil)
(Cons y ys xs, Match u y ys "" "end" rest) => Match u ">" xs acc "multi" (UrlCons (Multi acc) UrlNil)
Match u ">" "" acc "key" (UrlCons (Key acc) UrlNil)
Match u "?" xs acc "lit" (UrlCons (Lit acc) UrlNil)
Match u "?" xs "" any UrlNil
(Append acc x newAcc) => Match u x "" acc "lit" (UrlCons (Lit newAcc) UrlNil)
#UrlCons Source
data UrlCons :: UrlPart -> UrlList -> UrlList
Instances
(IsSymbol key, ShowUrl rest) => ShowUrl (UrlCons (Key key) rest)
(IsSymbol multi, ShowUrl rest) => ShowUrl (UrlCons (Multi multi) rest)
(IsSymbol lit, ShowUrl rest) => ShowUrl (UrlCons (Lit lit) rest)
(IsSymbol key, ToSegments rest) => ToSegments (UrlCons (Key key) rest)
(IsSymbol multi, ToSegments rest) => ToSegments (UrlCons (Multi multi) rest)
(IsSymbol lit, ToSegments rest) => ToSegments (UrlCons (Lit lit) rest)
Match u "/" "" acc "lit" (UrlCons (Lit acc) UrlNil)
Match u ">" "" acc "multi" (UrlCons (Multi acc) UrlNil)
(Cons y ys xs, Match u y ys "" "end" rest) => Match u ">" xs acc "multi" (UrlCons (Multi acc) UrlNil)
Match u ">" "" acc "key" (UrlCons (Key acc) UrlNil)
(Cons y ys xs, Match u y ys "" "start" rest) => Match u ">" xs acc "key" (UrlCons (Key acc) rest)
Match u "?" xs acc "lit" (UrlCons (Lit acc) UrlNil)
(Cons y ys xs, Match u y ys "" "any" rest) => Match u "/" xs "" "any" (UrlCons (Lit "") rest)
(Cons y ys xs, Match u y ys "" "any" rest) => Match u "/" xs acc "lit" (UrlCons (Lit acc) rest)
(Append acc x newAcc) => Match u x "" acc "lit" (UrlCons (Lit newAcc) UrlNil)
#UrlParseFail Source
data UrlParseFail :: UrlList
Instances
(ParseError "" "" "Paths must start with /" doc) => ParseUrl "" UrlParseFail
(Cons x xs fullUrl, ParseError u xs "Missing / - path segments must start with / and be separated by /" doc) => Match u x xs acc "start" UrlParseFail
(ParseError u xs "multi-segment matches must have a name" doc) => Match u ">" xs "" "multi" UrlParseFail
(ParseError u "" "multi tag was not closed" doc) => Match u x "" acc "multi" UrlParseFail
(ParseError u xs "tags cannot be nested in multi tags" doc) => Match u "<" xs acc "multi" UrlParseFail
(ParseError u xs "key matches must have name" doc) => Match u ">" xs "" "key" UrlParseFail
(Append acc x key, ParseError u "" "key tag was not closed" doc) => Match u x "" acc "key" UrlParseFail
(ParseError u xs "key tags cannot be nested" doc) => Match u "<" xs acc "key" UrlParseFail
(ParseError u xs "saw closing \'>\' for key without opening \'<\'" doc) => Match u ">" xs acc mode UrlParseFail
#ParseUrl Source
class ParseUrl (string :: Symbol) (parts :: UrlList) | string -> parts
Instances
(ParseError "" "" "Paths must start with /" doc) => ParseUrl "" UrlParseFail
(Cons h t string, Match string h t "" "start" fl) => ParseUrl string fl
#Match Source
class Match (url :: Symbol) (head :: Symbol) (tail :: Symbol) (acc :: Symbol) (mode :: Symbol) (out :: UrlList) | head tail acc mode -> out
Instances
Match u "/" "" "" mode UrlNil
Match u "/" "" acc "lit" (UrlCons (Lit acc) UrlNil)
(Cons y ys xs, Match u y ys "" "any" rest) => Match u "/" xs acc "start" rest
(Cons x xs fullUrl, ParseError u xs "Missing / - path segments must start with / and be separated by /" doc) => Match u x xs acc "start" UrlParseFail
(ParseError u xs "multi-segment matches must have a name" doc) => Match u ">" xs "" "multi" UrlParseFail
Match u ">" "" acc "multi" (UrlCons (Multi acc) UrlNil)
(Cons y ys xs, Match u y ys "" "end" rest) => Match u ">" xs acc "multi" (UrlCons (Multi acc) UrlNil)
(ParseError u "" "multi tag was not closed" doc) => Match u x "" acc "multi" UrlParseFail
(ParseError u xs "tags cannot be nested in multi tags" doc) => Match u "<" xs acc "multi" UrlParseFail
(Cons y ys xs, Append acc x newAcc, Match u y ys newAcc "multi" rest) => Match u x xs acc "multi" rest
(Cons y ys xs, Match u y ys "" "key" rest) => Match u "<" xs "" "any" rest
(Cons "." ys xs, Cons z zs ys, Match u z zs "" "multi" rest) => Match u "." xs "" "key" rest
(ParseError u xs "key matches must have name" doc) => Match u ">" xs "" "key" UrlParseFail
Match u ">" "" acc "key" (UrlCons (Key acc) UrlNil)
(Cons y ys xs, Match u y ys "" "start" rest) => Match u ">" xs acc "key" (UrlCons (Key acc) rest)
(Append acc x key, ParseError u "" "key tag was not closed" doc) => Match u x "" acc "key" UrlParseFail
(ParseError u xs "key tags cannot be nested" doc) => Match u "<" xs acc "key" UrlParseFail
(Cons y ys xs, Append acc x newAcc, Match u y ys newAcc "key" rest) => Match u x xs acc "key" rest
(ParseError u xs "saw closing \'>\' for key without opening \'<\'" doc) => Match u ">" xs acc mode UrlParseFail
Match u "?" xs acc "lit" (UrlCons (Lit acc) UrlNil)
Match u "?" xs "" any UrlNil
(Cons y ys xs, Match u y ys "" "any" rest) => Match u "/" xs "" "any" (UrlCons (Lit "") rest)
(Cons y ys xs, Match u y ys x "lit" rest) => Match u x xs "" "any" rest
(Cons y ys xs, Match u y ys "" "any" rest) => Match u "/" xs acc "lit" (UrlCons (Lit acc) rest)
(Append acc x newAcc) => Match u x "" acc "lit" (UrlCons (Lit newAcc) UrlNil)
(Cons y ys xs, Append acc x newAcc, Match u y ys newAcc "lit" rest) => Match u x xs acc "lit" rest
(Fail (Beside (Text "Failed parsing URL at: \'") (Beside (Text h) (Beside (Text "\':\'") (Beside (Text t) (Beside (Text "\' (acc: \'") (Beside (Text acc) (Beside (Text "\', mode: ") (Beside (Text mode) (Text ")")))))))))) => Match u h t acc mode rest
#Lit Source
data Lit :: Symbol -> UrlPart
Instances
(IsSymbol lit, ShowUrl rest) => ShowUrl (UrlCons (Lit lit) rest)
(IsSymbol lit, ToSegments rest) => ToSegments (UrlCons (Lit lit) rest)
Match u "/" "" acc "lit" (UrlCons (Lit acc) UrlNil)
Match u "?" xs acc "lit" (UrlCons (Lit acc) UrlNil)
(Cons y ys xs, Match u y ys "" "any" rest) => Match u "/" xs "" "any" (UrlCons (Lit "") rest)
(Cons y ys xs, Match u y ys "" "any" rest) => Match u "/" xs acc "lit" (UrlCons (Lit acc) rest)
(Append acc x newAcc) => Match u x "" acc "lit" (UrlCons (Lit newAcc) UrlNil)
#Multi Source
data Multi :: Symbol -> UrlPart
Instances
(IsSymbol multi, ShowUrl rest) => ShowUrl (UrlCons (Multi multi) rest)
(IsSymbol multi, ToSegments rest) => ToSegments (UrlCons (Multi multi) rest)
Match u ">" "" acc "multi" (UrlCons (Multi acc) UrlNil)
(Cons y ys xs, Match u y ys "" "end" rest) => Match u ">" xs acc "multi" (UrlCons (Multi acc) UrlNil)
- Modules
- Payload.
Client - Payload.
Client. ClientApi - Payload.
Client. DecodeResponse - Payload.
Client. EncodeBody - Payload.
Client. EncodeParam - Payload.
Client. Internal. EncodeUri - Payload.
Client. Internal. Query - Payload.
Client. Internal. Url - Payload.
Client. Options - Payload.
Client. QueryParams - Payload.
Client. Queryable - Payload.
Client. Response - Payload.
ContentType - Payload.
Debug - Payload.
Headers - Payload.
Internal. QueryParsing - Payload.
Internal. Route - Payload.
Internal. UrlParsing - Payload.
Internal. Utils - Payload.
ResponseTypes - Payload.
Server - Payload.
Server. Cookies - Payload.
Server. DecodeBody - Payload.
Server. Guards - Payload.
Server. Handleable - Payload.
Server. Handlers - Payload.
Server. Internal. GuardParsing - Payload.
Server. Internal. MimeTypes - Payload.
Server. Internal. OmitEmpty - Payload.
Server. Internal. Query - Payload.
Server. Internal. Querystring - Payload.
Server. Internal. Request - Payload.
Server. Internal. ServerResponse - Payload.
Server. Internal. Trie - Payload.
Server. Internal. Url - Payload.
Server. Internal. UrlString - Payload.
Server. Params - Payload.
Server. Path - Payload.
Server. QueryParams - Payload.
Server. Response - Payload.
Server. Routable - Payload.
Server. Status - Payload.
Spec - Payload.
TypeErrors