Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Url = Url {
- unUrl :: Text
- newtype UrlTransformFn = Modify UnescapedTemplate
- applyUrlTransformFn :: MonadError TransformErrorBundle m => UrlTransformFn -> RequestTransformCtx -> Url -> m Url
- validateUrlTransformFn :: TemplatingEngine -> UrlTransformFn -> Validation TransformErrorBundle ()
Documentation
The actual URL string we are transforming.
This newtype is necessary because otherwise we end up with an orphan instance.
Instances
newtype UrlTransformFn Source #
The defunctionalized transformation function on Url
Instances
applyUrlTransformFn :: MonadError TransformErrorBundle m => UrlTransformFn -> RequestTransformCtx -> Url -> m Url Source #
Provide an implementation for the transformations defined by
UrlTransformFn
.
If one views UrlTransformFn
as an interface describing URL
transformations, this can be seen as an implementation of these
transformations as normal Haskell functions.
validateUrlTransformFn :: TemplatingEngine -> UrlTransformFn -> Validation TransformErrorBundle () Source #
Validate that the provided UrlTransformFn
is correct in the context of a
particular TemplatingEngine
.
This is a product of the fact that the correctness of a given transformation
may be dependent on zero, one, or more of the templated transformations
encoded within the given UrlTransformFn
.