urlpath-0.2: Painfully simple URL writing combinators

Safe HaskellSafe-Inferred
LanguageHaskell2010

UrlPath

Synopsis

Documentation

class Url plain m => UrlReader plain m where Source

A UrlReader is a ReaderT monad transformer, that just has conventions associated with it to decide how to "deploy".

In the sense I'm using here, "deployment" is really "how the hostname gets added to all urls". Change the deployment scheme by coerciing the Monad Reader.

Associated Types

type Result m :: * -> * Source

Methods

runUrlReader Source

Arguments

:: Url plain m 
=> m b

MonadReader with index string and result b

-> plain

Reader index

-> Result m b

Final result

Instances

(Monad m, Monoid plain, IsString plain) => UrlReader plain (AbsoluteUrlT plain m) 
(Monad m, Monoid plain, IsString plain) => UrlReader plain (GroundedUrlT plain m) 
(Monad m, Monoid plain, IsString plain) => UrlReader plain (RelativeUrlT plain m) 

class (IsString plain, Monoid plain, MonadReader plain m) => Url plain m where Source

Url is a relationship between an underlying (monomorphic) string type plain, and a deployment context m. We try to make the deployment style coercible at the top level - if the expression has a type Url String (AbsoluteUrlT String Identity) or Monad m => Url T.Text (GroundedUrlT LT.Text m) will force all use-cases within the expression to coerce to that type.

Methods

url Source

Arguments

:: UrlString plain

Url type, parameterized over a string type plain

-> m plain

Rendered Url in some context.

plainUrl Source

Arguments

:: plain

raw small string

-> m plain

Rendered string in some context.

Instances

(Monad m, Monoid plain, IsString plain) => Url plain (AbsoluteUrlT plain m) 
(Monad m, Monoid plain, IsString plain) => Url plain (GroundedUrlT plain m) 
(Monad m, Monoid plain, IsString plain) => Url plain (RelativeUrlT plain m)