markup 3.0.0 → 3.1.0
raw patch · 5 files changed
+151/−93 lines, 5 filesdep ~urlpath
Dependency ranges changed: urlpath
Files
- markup.cabal +12/−10
- src/Data/Markup.hs +17/−4
- src/Data/Markup/Class.hs +22/−2
- src/Data/Markup/Library.hs +89/−77
- src/Data/Markup/Types.hs +11/−0
markup.cabal view
@@ -1,5 +1,5 @@ Name: markup-Version: 3.0.0+Version: 3.1.0 Author: Athan Clark <athan.clark@gmail.com> Maintainer: Athan Clark <athan.clark@gmail.com> License: MIT@@ -7,18 +7,20 @@ Category: Data, Web Synopsis: Abstraction for HTML-embedded content Description:- This library tries to make things more uniformly controlled when working with- markup languages in haskell - namely /deployment/ of markup assets.+ This library tries to simplify deployment of common HTML constructs, for different+ HTML engines. . Deployment, from this library's perspective, means /how/ something can be rendered to markup, yet still achieve the same "result" to the end user (namely- the DOM).+ the DOM). For instance, we could use a @<link>@ tag to reference external Css,+ or we might insert the Css code /inline/ a @<style>@ tag. .- We use monad transformers to infer the deployment mechanism for a context of- markup. The three deployment mechanisms provided include /inline/ (content is- slapped between markup tags), /hosted/ (entirely external - uses raw text as a- url), and /local/ (which uses the <hackage.haskell.org/package/urlpath urlpath>- library to realize what kind of link to create).+ We use simple tags to infer the deployment mechanism for a context of+ markup. The three deployment mechanisms provided include+ .+ * /inline/ - the asset inserted between markup tags+ * /local/ - assets on the current server+ * /remote/ - assets referenced with a complete URI Cabal-Version: >= 1.10 Build-Type: Simple@@ -45,7 +47,7 @@ , resourcet , text , transformers-base- , urlpath >= 4.0.0+ , urlpath >= 4.1.0 Source-Repository head Type: git
src/Data/Markup.hs view
@@ -1,7 +1,20 @@+-- |+-- Module : Data.Markup+-- Copyright : (c) Athan L. Clark+-- License : MIT+--+-- Maintainer : Athan L. Clark <athan.clark@gmail.com>+-- Stability : experimental+-- Portability : GHC+--+-- This module re-exports the three children.+ module Data.Markup- ( module X+ ( module Data.Markup.Types+ , module Data.Markup.Class+ , module Data.Markup.Library ) where -import Data.Markup.Types as X-import Data.Markup.Class as X-import Data.Markup.Library as X+import Data.Markup.Types+import Data.Markup.Class+import Data.Markup.Library
src/Data/Markup/Class.hs view
@@ -2,9 +2,29 @@ MultiParamTypeClasses #-} +-- |+-- Module : Data.Markup.Class+-- Copyright : (c) Athan L. Clark+-- License : MIT+--+-- Maintainer : Athan L. Clark <athan.clark@gmail.com>+-- Stability : experimental+-- Portability : GHC+--+-- We expect the markup engines that we support to be /monadic/:+--+-- * they accumulate their data internally, in the monad - not a direct value+-- * they do not care about the data contained - <https://hackage.haskell.org/package/lucid lucid>+-- and <https://hackage.haskell.org/package/blaze-html blaze-html> both set the+-- contained data to unit @()@ in their combinators.+--+-- From this, we can make multiple calls to @deploy@ in a @do@ statement, and+-- none of the types will be ambiguous.++ module Data.Markup.Class where -- | Overload assets and their markup library, over some deployment-class Deploy symbol strategy input result where- deploy :: symbol -> strategy -> input -> result+class Deploy symbol strategy input markup where+ deploy :: symbol -> strategy -> input -> markup ()
src/Data/Markup/Library.hs view
@@ -7,6 +7,18 @@ , MultiParamTypeClasses #-} +-- |+-- Module : Data.Markup.Library+-- Copyright : (c) Athan L. Clark+-- License : MIT+--+-- Maintainer : Athan L. Clark <athan.clark@gmail.com>+-- Stability : experimental+-- Portability : GHC+--+-- This module enumerates the expected behavior for each type of asset to be+-- deployed.+ module Data.Markup.Library where import Data.Markup.Class@@ -41,19 +53,19 @@ L.img_ [L.src_ link] instance ( Monad m- ) => Deploy Image Remote T.Text (L.HtmlT m ()) where+ ) => Deploy Image Remote T.Text (L.HtmlT m) where deploy Image Remote link = linkedImageLucid link instance ( Monad m , MonadUrl Abs t (AbsoluteUrlT m)- ) => Deploy Image Remote (Path Abs t) (L.HtmlT (AbsoluteUrlT m) ()) where+ ) => Deploy Image Remote (Path Abs t) (L.HtmlT (AbsoluteUrlT m)) where deploy Image Remote i = do link <- lift (pathUrl i) linkedImageLucid (T.pack link) instance ( Monad m , MonadUrl Abs t (AbsoluteUrlT m)- ) => Deploy Image Remote (Location Abs t) (L.HtmlT (AbsoluteUrlT m) ()) where+ ) => Deploy Image Remote (Location Abs t) (L.HtmlT (AbsoluteUrlT m)) where deploy Image Remote i = do link <- lift (locUrl i) linkedImageLucid (T.pack link)@@ -62,33 +74,33 @@ -- Local instance ( Monad m- ) => Deploy Image Locally T.Text (L.HtmlT m ()) where+ ) => Deploy Image Locally T.Text (L.HtmlT m) where deploy Image Locally link = linkedImageLucid link instance ( Monad m , MonadUrl Abs t (GroundedUrlT m)- ) => Deploy Image Locally (Path Abs t) (L.HtmlT (GroundedUrlT m) ()) where+ ) => Deploy Image Locally (Path Abs t) (L.HtmlT (GroundedUrlT m)) where deploy Image Locally i = do link <- lift (pathUrl i) linkedImageLucid (T.pack link) instance ( Monad m , MonadUrl Rel t (RelativeUrlT m)- ) => Deploy Image Locally (Path Rel t) (L.HtmlT (RelativeUrlT m) ()) where+ ) => Deploy Image Locally (Path Rel t) (L.HtmlT (RelativeUrlT m)) where deploy Image Locally i = do link <- lift (pathUrl i) linkedImageLucid (T.pack link) instance ( Monad m , MonadUrl Abs t (GroundedUrlT m)- ) => Deploy Image Locally (Location Abs t) (L.HtmlT (GroundedUrlT m) ()) where+ ) => Deploy Image Locally (Location Abs t) (L.HtmlT (GroundedUrlT m)) where deploy Image Locally i = do link <- lift (locUrl i) linkedImageLucid (T.pack link) instance ( Monad m , MonadUrl Rel t (RelativeUrlT m)- ) => Deploy Image Locally (Location Rel t) (L.HtmlT (RelativeUrlT m) ()) where+ ) => Deploy Image Locally (Location Rel t) (L.HtmlT (RelativeUrlT m)) where deploy Image Locally i = do link <- lift (locUrl i) linkedImageLucid (T.pack link)@@ -102,17 +114,17 @@ linkedImageBlaze link = H.img H.! A.src (H.toValue link) -instance Deploy Image Remote T.Text (HI.MarkupM ()) where+instance Deploy Image Remote T.Text (HI.MarkupM) where deploy Image Remote link = linkedImageBlaze link instance ( MonadUrl Abs t (AbsoluteUrlT HI.MarkupM)- ) => Deploy Image Remote (Path Abs t) (AbsoluteUrlT HI.MarkupM ()) where+ ) => Deploy Image Remote (Path Abs t) (AbsoluteUrlT HI.MarkupM) where deploy Image Remote i = do link <- pathUrl i lift (linkedImageBlaze (T.pack link)) instance ( MonadUrl Abs t (AbsoluteUrlT HI.MarkupM)- ) => Deploy Image Remote (Location Abs t) (AbsoluteUrlT HI.MarkupM ()) where+ ) => Deploy Image Remote (Location Abs t) (AbsoluteUrlT HI.MarkupM) where deploy Image Remote i = do link <- locUrl i lift (linkedImageBlaze (T.pack link))@@ -120,29 +132,29 @@ -- Local -instance Deploy Image Locally T.Text (HI.MarkupM ()) where+instance Deploy Image Locally T.Text (HI.MarkupM) where deploy Image Locally link = linkedImageBlaze link instance ( MonadUrl Abs t (GroundedUrlT HI.MarkupM)- ) => Deploy Image Locally (Path Abs t) (GroundedUrlT HI.MarkupM ()) where+ ) => Deploy Image Locally (Path Abs t) (GroundedUrlT HI.MarkupM) where deploy Image Locally i = do link <- pathUrl i lift (linkedImageBlaze (T.pack link)) instance ( MonadUrl Rel t (RelativeUrlT HI.MarkupM)- ) => Deploy Image Locally (Path Rel t) (RelativeUrlT HI.MarkupM ()) where+ ) => Deploy Image Locally (Path Rel t) (RelativeUrlT HI.MarkupM) where deploy Image Locally i = do link <- pathUrl i lift (linkedImageBlaze (T.pack link)) instance ( MonadUrl Abs t (GroundedUrlT HI.MarkupM)- ) => Deploy Image Locally (Location Abs t) (GroundedUrlT HI.MarkupM ()) where+ ) => Deploy Image Locally (Location Abs t) (GroundedUrlT HI.MarkupM) where deploy Image Locally i = do link <- locUrl i lift (linkedImageBlaze (T.pack link)) instance ( MonadUrl Rel t (RelativeUrlT HI.MarkupM)- ) => Deploy Image Locally (Location Rel t) (RelativeUrlT HI.MarkupM ()) where+ ) => Deploy Image Locally (Location Rel t) (RelativeUrlT HI.MarkupM) where deploy Image Locally i = do link <- locUrl i lift (linkedImageBlaze (T.pack link))@@ -157,19 +169,19 @@ L.script_ [L.src_ link] ("" :: T.Text) instance ( Monad m- ) => Deploy JavaScript Remote T.Text (L.HtmlT m ()) where+ ) => Deploy JavaScript Remote T.Text (L.HtmlT m) where deploy JavaScript Remote link = linkedJavaScriptLucid link instance ( Monad m , MonadUrl Abs t (AbsoluteUrlT m)- ) => Deploy JavaScript Remote (Path Abs t) (L.HtmlT (AbsoluteUrlT m) ()) where+ ) => Deploy JavaScript Remote (Path Abs t) (L.HtmlT (AbsoluteUrlT m)) where deploy JavaScript Remote i = do link <- lift (pathUrl i) linkedJavaScriptLucid (T.pack link) instance ( Monad m , MonadUrl Abs t (AbsoluteUrlT m)- ) => Deploy JavaScript Remote (Location Abs t) (L.HtmlT (AbsoluteUrlT m) ()) where+ ) => Deploy JavaScript Remote (Location Abs t) (L.HtmlT (AbsoluteUrlT m)) where deploy JavaScript Remote i = do link <- lift (locUrl i) linkedJavaScriptLucid (T.pack link)@@ -178,33 +190,33 @@ -- Local instance ( Monad m- ) => Deploy JavaScript Locally T.Text (L.HtmlT m ()) where+ ) => Deploy JavaScript Locally T.Text (L.HtmlT m) where deploy JavaScript Locally link = linkedJavaScriptLucid link instance ( Monad m , MonadUrl Abs t (GroundedUrlT m)- ) => Deploy JavaScript Locally (Path Abs t) (L.HtmlT (GroundedUrlT m) ()) where+ ) => Deploy JavaScript Locally (Path Abs t) (L.HtmlT (GroundedUrlT m)) where deploy JavaScript Locally i = do link <- lift (pathUrl i) linkedJavaScriptLucid (T.pack link) instance ( Monad m , MonadUrl Rel t (RelativeUrlT m)- ) => Deploy JavaScript Locally (Path Rel t) (L.HtmlT (RelativeUrlT m) ()) where+ ) => Deploy JavaScript Locally (Path Rel t) (L.HtmlT (RelativeUrlT m)) where deploy JavaScript Locally i = do link <- lift (pathUrl i) linkedJavaScriptLucid (T.pack link) instance ( Monad m , MonadUrl Abs t (GroundedUrlT m)- ) => Deploy JavaScript Locally (Location Abs t) (L.HtmlT (GroundedUrlT m) ()) where+ ) => Deploy JavaScript Locally (Location Abs t) (L.HtmlT (GroundedUrlT m)) where deploy JavaScript Locally i = do link <- lift (locUrl i) linkedJavaScriptLucid (T.pack link) instance ( Monad m , MonadUrl Rel t (RelativeUrlT m)- ) => Deploy JavaScript Locally (Location Rel t) (L.HtmlT (RelativeUrlT m) ()) where+ ) => Deploy JavaScript Locally (Location Rel t) (L.HtmlT (RelativeUrlT m)) where deploy JavaScript Locally i = do link <- lift (locUrl i) linkedJavaScriptLucid (T.pack link)@@ -212,12 +224,12 @@ -- Inline instance ( Monad m- ) => Deploy JavaScript Inline T.Text (L.HtmlT m ()) where+ ) => Deploy JavaScript Inline T.Text (L.HtmlT m) where deploy JavaScript Inline i = L.script_ [] i instance ( Monad m- ) => Deploy JavaScript Inline LT.Text (L.HtmlT m ()) where+ ) => Deploy JavaScript Inline LT.Text (L.HtmlT m) where deploy JavaScript Inline i = L.script_ [] i @@ -230,17 +242,17 @@ linkedJavaScriptBlaze link = H.script (H.toHtml ("" :: T.Text)) H.! (A.src $ H.toValue link) -instance Deploy JavaScript Remote T.Text (HI.MarkupM ()) where+instance Deploy JavaScript Remote T.Text (HI.MarkupM) where deploy JavaScript Remote link = linkedJavaScriptBlaze link instance ( MonadUrl Abs t (AbsoluteUrlT HI.MarkupM)- ) => Deploy JavaScript Remote (Path Abs t) (AbsoluteUrlT HI.MarkupM ()) where+ ) => Deploy JavaScript Remote (Path Abs t) (AbsoluteUrlT HI.MarkupM) where deploy JavaScript Remote i = do link <- pathUrl i lift (linkedJavaScriptBlaze (T.pack link)) instance ( MonadUrl Abs t (AbsoluteUrlT HI.MarkupM)- ) => Deploy JavaScript Remote (Location Abs t) (AbsoluteUrlT HI.MarkupM ()) where+ ) => Deploy JavaScript Remote (Location Abs t) (AbsoluteUrlT HI.MarkupM) where deploy JavaScript Remote i = do link <- locUrl i lift (linkedJavaScriptBlaze (T.pack link))@@ -248,40 +260,40 @@ -- Local -instance Deploy JavaScript Locally T.Text (HI.MarkupM ()) where+instance Deploy JavaScript Locally T.Text (HI.MarkupM) where deploy JavaScript Locally link = linkedJavaScriptBlaze link instance ( MonadUrl Abs t (GroundedUrlT HI.MarkupM)- ) => Deploy JavaScript Locally (Path Abs t) (GroundedUrlT HI.MarkupM ()) where+ ) => Deploy JavaScript Locally (Path Abs t) (GroundedUrlT HI.MarkupM) where deploy JavaScript Locally i = do link <- pathUrl i lift (linkedJavaScriptBlaze (T.pack link)) instance ( MonadUrl Rel t (RelativeUrlT HI.MarkupM)- ) => Deploy JavaScript Locally (Path Rel t) (RelativeUrlT HI.MarkupM ()) where+ ) => Deploy JavaScript Locally (Path Rel t) (RelativeUrlT HI.MarkupM) where deploy JavaScript Locally i = do link <- pathUrl i lift (linkedJavaScriptBlaze (T.pack link)) instance ( MonadUrl Abs t (GroundedUrlT HI.MarkupM)- ) => Deploy JavaScript Locally (Location Abs t) (GroundedUrlT HI.MarkupM ()) where+ ) => Deploy JavaScript Locally (Location Abs t) (GroundedUrlT HI.MarkupM) where deploy JavaScript Locally i = do link <- locUrl i lift (linkedJavaScriptBlaze (T.pack link)) instance ( MonadUrl Rel t (RelativeUrlT HI.MarkupM)- ) => Deploy JavaScript Locally (Location Rel t) (RelativeUrlT HI.MarkupM ()) where+ ) => Deploy JavaScript Locally (Location Rel t) (RelativeUrlT HI.MarkupM) where deploy JavaScript Locally i = do link <- locUrl i lift (linkedJavaScriptBlaze (T.pack link)) -- Inline -instance Deploy JavaScript Inline T.Text (HI.MarkupM ()) where+instance Deploy JavaScript Inline T.Text (HI.MarkupM) where deploy JavaScript Inline i = H.script (H.toHtml i) -instance Deploy JavaScript Inline LT.Text (HI.MarkupM ()) where+instance Deploy JavaScript Inline LT.Text (HI.MarkupM) where deploy JavaScript Inline i = H.script (H.toHtml i) @@ -298,19 +310,19 @@ ] instance ( Monad m- ) => Deploy Css Remote T.Text (L.HtmlT m ()) where+ ) => Deploy Css Remote T.Text (L.HtmlT m) where deploy Css Remote link = linkedCssLucid link instance ( Monad m , MonadUrl Abs t (AbsoluteUrlT m)- ) => Deploy Css Remote (Path Abs t) (L.HtmlT (AbsoluteUrlT m) ()) where+ ) => Deploy Css Remote (Path Abs t) (L.HtmlT (AbsoluteUrlT m)) where deploy Css Remote i = do link <- lift (pathUrl i) linkedCssLucid (T.pack link) instance ( Monad m , MonadUrl Abs t (AbsoluteUrlT m)- ) => Deploy Css Remote (Location Abs t) (L.HtmlT (AbsoluteUrlT m) ()) where+ ) => Deploy Css Remote (Location Abs t) (L.HtmlT (AbsoluteUrlT m)) where deploy Css Remote i = do link <- lift (locUrl i) linkedCssLucid (T.pack link)@@ -319,33 +331,33 @@ -- Local instance ( Monad m- ) => Deploy Css Locally T.Text (L.HtmlT m ()) where+ ) => Deploy Css Locally T.Text (L.HtmlT m) where deploy Css Locally link = linkedCssLucid link instance ( Monad m , MonadUrl Abs t (GroundedUrlT m)- ) => Deploy Css Locally (Path Abs t) (L.HtmlT (GroundedUrlT m) ()) where+ ) => Deploy Css Locally (Path Abs t) (L.HtmlT (GroundedUrlT m)) where deploy Css Locally i = do link <- lift (pathUrl i) linkedCssLucid (T.pack link) instance ( Monad m , MonadUrl Rel t (RelativeUrlT m)- ) => Deploy Css Locally (Path Rel t) (L.HtmlT (RelativeUrlT m) ()) where+ ) => Deploy Css Locally (Path Rel t) (L.HtmlT (RelativeUrlT m)) where deploy Css Locally i = do link <- lift (pathUrl i) linkedCssLucid (T.pack link) instance ( Monad m , MonadUrl Abs t (GroundedUrlT m)- ) => Deploy Css Locally (Location Abs t) (L.HtmlT (GroundedUrlT m) ()) where+ ) => Deploy Css Locally (Location Abs t) (L.HtmlT (GroundedUrlT m)) where deploy Css Locally i = do link <- lift (locUrl i) linkedCssLucid (T.pack link) instance ( Monad m , MonadUrl Rel t (RelativeUrlT m)- ) => Deploy Css Locally (Location Rel t) (L.HtmlT (RelativeUrlT m) ()) where+ ) => Deploy Css Locally (Location Rel t) (L.HtmlT (RelativeUrlT m)) where deploy Css Locally i = do link <- lift (locUrl i) linkedCssLucid (T.pack link)@@ -353,17 +365,17 @@ -- Inline instance ( Monad m- ) => Deploy Css Inline T.Text (L.HtmlT m ()) where+ ) => Deploy Css Inline T.Text (L.HtmlT m) where deploy Css Inline i = L.style_ [] i instance ( Monad m- ) => Deploy Css Inline LT.Text (L.HtmlT m ()) where+ ) => Deploy Css Inline LT.Text (L.HtmlT m) where deploy Css Inline i = L.style_ [] i instance ( Monad m- ) => Deploy Css Inline C.Css (L.HtmlT m ()) where+ ) => Deploy Css Inline C.Css (L.HtmlT m) where deploy Css Inline i = L.style_ [] (C.render i) @@ -378,17 +390,17 @@ H.! A.type_ "text/css" H.! A.href (H.toValue link) -instance Deploy Css Remote T.Text (HI.MarkupM ()) where+instance Deploy Css Remote T.Text (HI.MarkupM) where deploy Css Remote link = linkedCssBlaze link instance ( MonadUrl Abs t (AbsoluteUrlT HI.MarkupM)- ) => Deploy Css Remote (Path Abs t) (AbsoluteUrlT HI.MarkupM ()) where+ ) => Deploy Css Remote (Path Abs t) (AbsoluteUrlT HI.MarkupM) where deploy Css Remote i = do link <- pathUrl i lift (linkedCssBlaze (T.pack link)) instance ( MonadUrl Abs t (AbsoluteUrlT HI.MarkupM)- ) => Deploy Css Remote (Location Abs t) (AbsoluteUrlT HI.MarkupM ()) where+ ) => Deploy Css Remote (Location Abs t) (AbsoluteUrlT HI.MarkupM) where deploy Css Remote i = do link <- locUrl i lift (linkedCssBlaze (T.pack link))@@ -396,44 +408,44 @@ -- Local -instance Deploy Css Locally T.Text (HI.MarkupM ()) where+instance Deploy Css Locally T.Text (HI.MarkupM) where deploy Css Locally link = linkedCssBlaze link instance ( MonadUrl Abs t (GroundedUrlT HI.MarkupM)- ) => Deploy Css Locally (Path Abs t) (GroundedUrlT HI.MarkupM ()) where+ ) => Deploy Css Locally (Path Abs t) (GroundedUrlT HI.MarkupM) where deploy Css Locally i = do link <- pathUrl i lift (linkedCssBlaze (T.pack link)) instance ( MonadUrl Rel t (RelativeUrlT HI.MarkupM)- ) => Deploy Css Locally (Path Rel t) (RelativeUrlT HI.MarkupM ()) where+ ) => Deploy Css Locally (Path Rel t) (RelativeUrlT HI.MarkupM) where deploy Css Locally i = do link <- pathUrl i lift (linkedCssBlaze (T.pack link)) instance ( MonadUrl Abs t (GroundedUrlT HI.MarkupM)- ) => Deploy Css Locally (Location Abs t) (GroundedUrlT HI.MarkupM ()) where+ ) => Deploy Css Locally (Location Abs t) (GroundedUrlT HI.MarkupM) where deploy Css Locally i = do link <- locUrl i lift (linkedCssBlaze (T.pack link)) instance ( MonadUrl Rel t (RelativeUrlT HI.MarkupM)- ) => Deploy Css Locally (Location Rel t) (RelativeUrlT HI.MarkupM ()) where+ ) => Deploy Css Locally (Location Rel t) (RelativeUrlT HI.MarkupM) where deploy Css Locally i = do link <- locUrl i lift (linkedCssBlaze (T.pack link)) -- Inline -instance Deploy Css Inline T.Text (HI.MarkupM ()) where+instance Deploy Css Inline T.Text (HI.MarkupM) where deploy Css Inline i = H.style (H.toHtml i) -instance Deploy Css Inline LT.Text (HI.MarkupM ()) where+instance Deploy Css Inline LT.Text (HI.MarkupM) where deploy Css Inline i = H.style (H.toHtml i) -instance Deploy Css Inline C.Css (HI.MarkupM ()) where+instance Deploy Css Inline C.Css (HI.MarkupM) where deploy Css Inline i = H.style (H.toHtml (C.render i)) @@ -449,19 +461,19 @@ ] instance ( Monad m- ) => Deploy WebComponent Remote T.Text (L.HtmlT m ()) where+ ) => Deploy WebComponent Remote T.Text (L.HtmlT m) where deploy WebComponent Remote link = linkedWebComponentLucid link instance ( Monad m , MonadUrl Abs t (AbsoluteUrlT m)- ) => Deploy WebComponent Remote (Path Abs t) (L.HtmlT (AbsoluteUrlT m) ()) where+ ) => Deploy WebComponent Remote (Path Abs t) (L.HtmlT (AbsoluteUrlT m)) where deploy WebComponent Remote i = do link <- lift (pathUrl i) linkedWebComponentLucid (T.pack link) instance ( Monad m , MonadUrl Abs t (AbsoluteUrlT m)- ) => Deploy WebComponent Remote (Location Abs t) (L.HtmlT (AbsoluteUrlT m) ()) where+ ) => Deploy WebComponent Remote (Location Abs t) (L.HtmlT (AbsoluteUrlT m)) where deploy WebComponent Remote i = do link <- lift (locUrl i) linkedWebComponentLucid (T.pack link)@@ -470,7 +482,7 @@ -- , MonadUrl Abs t (AbsoluteUrlT m) -- , MonadThrow (AbsoluteUrlT m) -- , ToLocation s Abs t--- ) => Deploy WebComponent s (L.HtmlT (AbsoluteUrlT m) ()) where+-- ) => Deploy WebComponent s (L.HtmlT (AbsoluteUrlT m)) where -- deploy WebComponent Remote i = do -- i' <- lift (toLocation i) -- link <- lift (locUrl i')@@ -480,33 +492,33 @@ -- Local instance ( Monad m- ) => Deploy WebComponent Locally T.Text (L.HtmlT m ()) where+ ) => Deploy WebComponent Locally T.Text (L.HtmlT m) where deploy WebComponent Locally link = linkedWebComponentLucid link instance ( Monad m , MonadUrl Abs t (GroundedUrlT m)- ) => Deploy WebComponent Locally (Path Abs t) (L.HtmlT (GroundedUrlT m) ()) where+ ) => Deploy WebComponent Locally (Path Abs t) (L.HtmlT (GroundedUrlT m)) where deploy WebComponent Locally i = do link <- lift (pathUrl i) linkedWebComponentLucid (T.pack link) instance ( Monad m , MonadUrl Rel t (RelativeUrlT m)- ) => Deploy WebComponent Locally (Path Rel t) (L.HtmlT (RelativeUrlT m) ()) where+ ) => Deploy WebComponent Locally (Path Rel t) (L.HtmlT (RelativeUrlT m)) where deploy WebComponent Locally i = do link <- lift (pathUrl i) linkedWebComponentLucid (T.pack link) instance ( Monad m , MonadUrl Abs t (GroundedUrlT m)- ) => Deploy WebComponent Locally (Location Abs t) (L.HtmlT (GroundedUrlT m) ()) where+ ) => Deploy WebComponent Locally (Location Abs t) (L.HtmlT (GroundedUrlT m)) where deploy WebComponent Locally i = do link <- lift (locUrl i) linkedWebComponentLucid (T.pack link) instance ( Monad m , MonadUrl Rel t (RelativeUrlT m)- ) => Deploy WebComponent Locally (Location Rel t) (L.HtmlT (RelativeUrlT m) ()) where+ ) => Deploy WebComponent Locally (Location Rel t) (L.HtmlT (RelativeUrlT m)) where deploy WebComponent Locally i = do link <- lift (locUrl i) linkedWebComponentLucid (T.pack link)@@ -515,7 +527,7 @@ -- , MonadUrl Abs t (GroundedUrlT m) -- , MonadThrow (GroundedUrlT m) -- , ToLocation s Abs t--- ) => Deploy WebComponent Locally s (L.HtmlT (GroundedUrlT m) ()) where+-- ) => Deploy WebComponent Locally s (L.HtmlT (GroundedUrlT m)) where -- deploy WebComponent Locally i = do -- i' <- lift (toLocation i) -- link <- lift (locUrl i')@@ -525,7 +537,7 @@ -- , MonadUrl Rel t (RelativeUrlT m) -- , MonadThrow (RelativeUrlT m) -- , ToLocation s Rel t--- ) => Deploy WebComponent Locally s (L.HtmlT (RelativeUrlT m) ()) where+-- ) => Deploy WebComponent Locally s (L.HtmlT (RelativeUrlT m)) where -- deploy WebComponent Locally i = do -- i' <- lift (toLocation i) -- link <- lift (locUrl i')@@ -540,17 +552,17 @@ H.link H.! A.rel "import" H.! A.href (H.toValue link) -instance Deploy WebComponent Remote T.Text (HI.MarkupM ()) where+instance Deploy WebComponent Remote T.Text (HI.MarkupM) where deploy WebComponent Remote link = linkedWebComponentBlaze link instance ( MonadUrl Abs t (AbsoluteUrlT HI.MarkupM)- ) => Deploy WebComponent Remote (Path Abs t) (AbsoluteUrlT HI.MarkupM ()) where+ ) => Deploy WebComponent Remote (Path Abs t) (AbsoluteUrlT HI.MarkupM) where deploy WebComponent Remote i = do link <- pathUrl i lift (linkedWebComponentBlaze (T.pack link)) instance ( MonadUrl Abs t (AbsoluteUrlT HI.MarkupM)- ) => Deploy WebComponent Remote (Location Abs t) (AbsoluteUrlT HI.MarkupM ()) where+ ) => Deploy WebComponent Remote (Location Abs t) (AbsoluteUrlT HI.MarkupM) where deploy WebComponent Remote i = do link <- locUrl i lift (linkedWebComponentBlaze (T.pack link))@@ -558,29 +570,29 @@ -- Local -instance Deploy WebComponent Locally T.Text (HI.MarkupM ()) where+instance Deploy WebComponent Locally T.Text (HI.MarkupM) where deploy WebComponent Locally link = linkedWebComponentBlaze link instance ( MonadUrl Abs t (GroundedUrlT HI.MarkupM)- ) => Deploy WebComponent Locally (Path Abs t) (GroundedUrlT HI.MarkupM ()) where+ ) => Deploy WebComponent Locally (Path Abs t) (GroundedUrlT HI.MarkupM) where deploy WebComponent Locally i = do link <- pathUrl i lift (linkedWebComponentBlaze (T.pack link)) instance ( MonadUrl Rel t (RelativeUrlT HI.MarkupM)- ) => Deploy WebComponent Locally (Path Rel t) (RelativeUrlT HI.MarkupM ()) where+ ) => Deploy WebComponent Locally (Path Rel t) (RelativeUrlT HI.MarkupM) where deploy WebComponent Locally i = do link <- pathUrl i lift (linkedWebComponentBlaze (T.pack link)) instance ( MonadUrl Abs t (GroundedUrlT HI.MarkupM)- ) => Deploy WebComponent Locally (Location Abs t) (GroundedUrlT HI.MarkupM ()) where+ ) => Deploy WebComponent Locally (Location Abs t) (GroundedUrlT HI.MarkupM) where deploy WebComponent Locally i = do link <- locUrl i lift (linkedWebComponentBlaze (T.pack link)) instance ( MonadUrl Rel t (RelativeUrlT HI.MarkupM)- ) => Deploy WebComponent Locally (Location Rel t) (RelativeUrlT HI.MarkupM ()) where+ ) => Deploy WebComponent Locally (Location Rel t) (RelativeUrlT HI.MarkupM) where deploy WebComponent Locally i = do link <- locUrl i lift (linkedWebComponentBlaze (T.pack link))
src/Data/Markup/Types.hs view
@@ -1,3 +1,14 @@+-- |+-- Module : Data.Markup.Types+-- Copyright : (c) Athan L. Clark+-- License : MIT+--+-- Maintainer : Athan L. Clark <athan.clark@gmail.com>+-- Stability : experimental+-- Portability : GHC+++ module Data.Markup.Types where