packages feed

Spock-lucid 0.2.0.0 → 0.3.0.0

raw patch · 3 files changed

+18/−3 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Web.Spock.Lucid: lucidT :: MonadIO m => HtmlT m a -> ActionCtxT cxt m a

Files

CHANGELOG.md view
@@ -1,7 +1,11 @@+# 0.3.0.0++* Added `lucidT`.+ # 0.2.0.0 -* Change types (the previous version was unusable).-* Actually return the value returned by the Lucid action.+* Changed types (the previous version was unusable).+* Now the value returned by the Lucid action is *actually* returned.  # 0.1.0.0 (deprecated) 
Spock-lucid.cabal view
@@ -1,5 +1,5 @@ name:                Spock-lucid-version:             0.2.0.0+version:             0.3.0.0 synopsis:            Lucid support for Spock description:   Lucid support for Spock
lib/Web/Spock/Lucid.hs view
@@ -9,12 +9,14 @@ (   lucid,   lucidIO,+  lucidT, ) where   import Data.Functor.Identity import Control.Monad.IO.Class+import Control.Monad.Trans.Class import Web.Spock import Lucid.Base import Blaze.ByteString.Builder@@ -42,3 +44,12 @@   return a {-# INLINE lucidIO #-} +-- | Like 'lucid', but for arbitrary monads. Might require some additional+-- boilerplate.+lucidT :: MonadIO m => HtmlT m a -> ActionCtxT cxt m a+lucidT x = do+  setHeader "Content-Type" "text/html; charset=utf-8"+  (render, a) <- lift (runHtmlT x)+  lazyBytes (toLazyByteString (render mempty))+  return a+{-# INLINE lucidT #-}