Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- class Url string m => UrlReader string m where
- runUrlReader :: Url string m => m string -> string -> string
- class (IsString string, Monoid string, MonadReader string m) => Url string m where
- module UrlPath.Types
Documentation
class Url string m => UrlReader string m where Source
Overload deployment schemes with this - then, all that's needed is a type coercion to change deployment. This only works with flat (co)monads, so monad transformers are out.
:: Url string m | |
=> m string | Monad with result |
-> string | Reader index |
-> string | Final result |
(Monoid a, IsString a) => UrlReader a (AbsoluteUrl a) | Hand-off host prepending to the MonadReader instance |
(Monoid a, IsString a) => UrlReader a (GroundedUrl a) | |
(Monoid a, IsString a) => UrlReader a (RelativeUrl a) |
class (IsString string, Monoid string, MonadReader string m) => Url string m where Source
Url
is a relationship between an underlying (monomorphic) string type
string
, and a deployment context m
. We try to make the deployment and
implementation type coercible at the top level - coercing your final
expression to String
or T.Text
will have all use-cases coerce to that
type, similarly with the deployment scheme.
We chose to not force MonadReader
as a superclass for m
due to the
monomorphic demand on functional dependencies.
:: UrlString string | Url type |
-> m string | Rendered Url in some context. |
:: string | raw string |
-> m string | Rendered string in some context. |
(Monoid a, IsString a) => Url a (AbsoluteUrl a) | |
(Monoid a, IsString a) => Url a (GroundedUrl a) | |
(Monoid a, IsString a) => Url a (RelativeUrl a) | |
(Monad m, Monoid a, IsString a) => Url a (AbsoluteUrlT a m) | |
(Monad m, Monoid a, IsString a) => Url a (GroundedUrlT a m) | |
(Monad m, Monoid a, IsString a) => Url a (RelativeUrlT a m) |
module UrlPath.Types