burrito-1.2.0.1: Parse and render URI templates.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Burrito.Internal.Type.Template

Synopsis

Documentation

newtype Template Source #

Represents a URI template.

Constructors

Template 

Fields

Instances

Instances details
Eq Template Source # 
Instance details

Defined in Burrito.Internal.Type.Template

Data Template Source # 
Instance details

Defined in Burrito.Internal.Type.Template

Methods

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

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

toConstr :: Template -> Constr #

dataTypeOf :: Template -> DataType #

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

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

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

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

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

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

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

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

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

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

Ord Template Source # 
Instance details

Defined in Burrito.Internal.Type.Template

Show Template Source # 
Instance details

Defined in Burrito.Internal.Type.Template

render :: Template -> String Source #

Renders a template back into a string. This is essentially the opposite of parse. Usually you'll want to use expand to actually substitute variables in the template, but this can be useful for printing out the template itself

>>> render <$> parse "valid-template"
Just "valid-template"
>>> render <$> parse "{var}"
Just "{var}"