The urlpath package

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

Simple URL DSL for Haskell.

Use raw combinators (kinda useless) ...

 render $ "foo.php" <?> ("key1","bar") <&> ("key2","baz")

 ↪ "foo.php?key1=bar&key2=baz"

... or use the MonadReader instance for a configurable root ...

 let url = runReader $ expandAbsolute $ "foo.php" <?> ("key1","bar") <&> ("key2","baz")
 url "example.com"

 ↪ "example.com/foo.php?key1=bar&key2=baz"

... in Lucid ...

 (runReader $ renderTextT $
   (\a -> do
     foo <- lift $ expandAbsolute a
     script_ [src_ foo] "" )
   ("foo" <?> ("bar","baz"))
 ) "example.com"

 ↪ "<script src=\"example.com/foo?bar=baz\"></script>"

... and in Scotty ...

 main :: IO ()
 main = scottyT 3000
     rootConf
     rootConf
     run

   where
     rootConf = flip runReaderT "http://example.com"

     run :: ( MonadIO m
            , MonadReader T.Text m ) =>
            ScottyT LT.Text m ()
     run = get "/" $ do
       path <- lift $ expandAbsolute $ "foo" <?> ("bar","baz")
       text $ LT.fromStrict path

 λ> curl localhost:3000/
 ↪ "http://example.com/foo?bar=baz"

Properties

Versions0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5, 0.0.6, 0.0.6, 0.1, 0.1.0.1, 0.2, 1.0.0, 1.1.0, 2.0.0, 2.1.0, 3.0.0, 3.1.0, 3.1.1, 3.2.0, 3.2.1, 3.2.1.1, 3.3.0, 4.0.0, 4.0.0.1, 4.1.0, 4.2.0, 5.0.0, 5.0.0.1, 6.0.0, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 7.0.0, 7.0.1
Change logNone available
Dependenciesbase (==4.*), mtl, text, transformers [details]
LicenseMIT
AuthorAthan Clark <athan.clark@gmail.com>
MaintainerAthan Clark <athan.clark@gmail.com>
CategoryWeb
Source repositoryhead: git clone https://github.com/athanclark/urlpath.git
UploadedThu Dec 11 22:05:49 UTC 2014 by athanclark

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees