hyperbole-0.5.0: Interactive HTML apps using type-safe serverside Haskell
Safe HaskellSafe-Inferred
LanguageGHC2021

Web.Hyperbole.Data.URI

Synopsis

URI

data URI #

Represents a general universal resource identifier using its component parts.

For example, for the URI

  foo://anonymous@www.haskell.org:42/ghc?query#frag

the components are:

Constructors

URI 

Fields

Instances

Instances details
Data URI 
Instance details

Defined in Network.URI

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> URI -> c URI #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c URI #

toConstr :: URI -> Constr #

dataTypeOf :: URI -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c URI) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URI) #

gmapT :: (forall b. Data b => b -> b) -> URI -> URI #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URI -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URI -> r #

gmapQ :: (forall d. Data d => d -> u) -> URI -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> URI -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> URI -> m URI #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> URI -> m URI #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> URI -> m URI #

Generic URI 
Instance details

Defined in Network.URI

Associated Types

type Rep URI :: Type -> Type #

Methods

from :: URI -> Rep URI x #

to :: Rep URI x -> URI #

Show URI 
Instance details

Defined in Network.URI

Methods

showsPrec :: Int -> URI -> ShowS #

show :: URI -> String #

showList :: [URI] -> ShowS #

NFData URI 
Instance details

Defined in Network.URI

Methods

rnf :: URI -> () #

Eq URI 
Instance details

Defined in Network.URI

Methods

(==) :: URI -> URI -> Bool #

(/=) :: URI -> URI -> Bool #

Ord URI 
Instance details

Defined in Network.URI

Methods

compare :: URI -> URI -> Ordering #

(<) :: URI -> URI -> Bool #

(<=) :: URI -> URI -> Bool #

(>) :: URI -> URI -> Bool #

(>=) :: URI -> URI -> Bool #

max :: URI -> URI -> URI #

min :: URI -> URI -> URI #

FromParam URI Source # 
Instance details

Defined in Web.Hyperbole.Data.Param

ToParam URI Source # 
Instance details

Defined in Web.Hyperbole.Data.Param

FromJSON URI

Since: aeson-2.2.0.0

Instance details

Defined in Data.Aeson.Types.FromJSON

FromJSONKey URI

Since: aeson-2.2.0.0

Instance details

Defined in Data.Aeson.Types.FromJSON

ToJSON URI

Since: aeson-2.2.0.0

Instance details

Defined in Data.Aeson.Types.ToJSON

ToJSONKey URI

Since: aeson-2.2.0.0

Instance details

Defined in Data.Aeson.Types.ToJSON

Lift URI 
Instance details

Defined in Network.URI

Methods

lift :: Quote m => URI -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => URI -> Code m URI #

type Rep URI 
Instance details

Defined in Network.URI

data URIAuth #

Type for authority value within a URI

Constructors

URIAuth 

Fields

Instances

Instances details
Data URIAuth 
Instance details

Defined in Network.URI

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> URIAuth -> c URIAuth #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c URIAuth #

toConstr :: URIAuth -> Constr #

dataTypeOf :: URIAuth -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c URIAuth) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c URIAuth) #

gmapT :: (forall b. Data b => b -> b) -> URIAuth -> URIAuth #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> URIAuth -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> URIAuth -> r #

gmapQ :: (forall d. Data d => d -> u) -> URIAuth -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> URIAuth -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> URIAuth -> m URIAuth #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> URIAuth -> m URIAuth #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> URIAuth -> m URIAuth #

Generic URIAuth 
Instance details

Defined in Network.URI

Associated Types

type Rep URIAuth :: Type -> Type #

Methods

from :: URIAuth -> Rep URIAuth x #

to :: Rep URIAuth x -> URIAuth #

Show URIAuth 
Instance details

Defined in Network.URI

NFData URIAuth 
Instance details

Defined in Network.URI

Methods

rnf :: URIAuth -> () #

Eq URIAuth 
Instance details

Defined in Network.URI

Methods

(==) :: URIAuth -> URIAuth -> Bool #

(/=) :: URIAuth -> URIAuth -> Bool #

Ord URIAuth 
Instance details

Defined in Network.URI

Lift URIAuth 
Instance details

Defined in Network.URI

Methods

lift :: Quote m => URIAuth -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => URIAuth -> Code m URIAuth #

type Rep URIAuth 
Instance details

Defined in Network.URI

type Rep URIAuth = D1 ('MetaData "URIAuth" "Network.URI" "ntwrk-r-2.6.4.2-33a473b9" 'False) (C1 ('MetaCons "URIAuth" 'PrefixI 'True) (S1 ('MetaSel ('Just "uriUserInfo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just "uriRegName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "uriPort") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

uri :: QuasiQuoter #

uri is a quasi quoter for staticURI.

>>> [uri|http://www.google.com/|]
http://www.google.com/
>>> [uri|http://www.google.com/##|]

<interactive>...
... Invalid URI: http://www.google.com/##
...

Path

newtype Path Source #

Constructors

Path 

Fields

Instances

Instances details
IsString Path Source # 
Instance details

Defined in Web.Hyperbole.Data.URI

Methods

fromString :: String -> Path #

IsList Path Source # 
Instance details

Defined in Web.Hyperbole.Data.URI

Associated Types

type Item Path #

Methods

fromList :: [Item Path] -> Path #

fromListN :: Int -> [Item Path] -> Path #

toList :: Path -> [Item Path] #

Show Path Source # 
Instance details

Defined in Web.Hyperbole.Data.URI

Methods

showsPrec :: Int -> Path -> ShowS #

show :: Path -> String #

showList :: [Path] -> ShowS #

Eq Path Source # 
Instance details

Defined in Web.Hyperbole.Data.URI

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

type Item Path Source # 
Instance details

Defined in Web.Hyperbole.Data.URI

parseURIReference :: String -> Maybe URI #

Parse a URI reference to a URI value. Returns Nothing if the string is not a valid URI reference. (an absolute or relative URI with optional fragment identifier).

Query String

parseQuery :: ByteString -> Query #

Split out the query string into a list of keys and values. A few importants points:

  • The result returned is still bytestrings, since we perform no character decoding here. Most likely, you will want to use UTF-8 decoding, but this is left to the user of the library.
  • Percent decoding errors are ignored. In particular, "%Q" will be output as "%Q".
  • It decodes '+' characters to ' '

Since: http-types-0.2.0

queryInsert :: ByteString -> Maybe ByteString -> QueryString -> QueryString Source #

renderQuery :: Bool -> Query -> ByteString #

Renders the given Query into a ByteString.

If you want a question mark (?) added to the front of the result, use True.

Since: http-types-0.2.0

type Query = [QueryItem] #

A sequence of QueryItems.

type QueryItem = (ByteString, Maybe ByteString) #

An item from the query string, split up into two parts.

The second part should be Nothing if there was no key-value separator after the query item name.

Since: http-types-0.2.0

(./.) :: URI -> Path -> URI infixl 5 Source #

newtype Endpoint a Source #

A URI with a phantom type to distinguish different endpoints

Constructors

Endpoint 

Fields