happstack-hamlet 6.1.1 → 6.1.2
raw patch · 2 files changed
+12/−20 lines, 2 filesdep −bytestringdep −containersdep ~hamletPVP ok
version bump matches the API change (PVP)
Dependencies removed: bytestring, containers
Dependency ranges changed: hamlet
API changes (from Hackage documentation)
Files
- Happstack/Server/Hamlet.hs +10/−16
- happstack-hamlet.cabal +2/−4
Happstack/Server/Hamlet.hs view
@@ -1,28 +1,22 @@ -- |This module provides support for using Hamlet with Happstack. Hamlet provides type-safe HTML generation. More information can be found at <http://patch-tag.com/r/mae/happstack/snapshot/current/content/pretty/happstack-hamlet/demo.hs> and <http://hackage.haskell.org/package/hamlet>.-{-# LANGUAGE QuasiQuotes, ScopedTypeVariables, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, UndecidableInstances #-} module Happstack.Server.Hamlet ( hamletToResponse ) where -import qualified Data.ByteString.Char8 as B-import qualified Data.ByteString.Lazy.Char8 as L-import qualified Data.Map as M-import Data.Text (Text)-import Text.Hamlet-import Happstack.Server-+import Data.Text (Text)+import Text.Hamlet (Hamlet)+import Happstack.Server (Response, toResponse) -- |turn a 'Hamlet' template into a Happstack 'Response'+--+-- Due to changes in Hamlet, this function is now just defined as:+--+-- > hamletToResponse showFn hamlet = toResponse $ hamlet showFn+--+-- You probably do not need to use this library at all these days. hamletToResponse :: (url -> [(Text, Text)] -> Text) -- ^ function to 'url' values in the template into their 'String' representation -> Hamlet url -- ^ a 'Hamlet' template -> Response hamletToResponse showFn hamlet = - let msg = renderHamlet showFn hamlet- in toResponse_ (B.pack "text/html; charset=UTF-8") msg---- available as toResponseBS in happstack-server >= 0.5-toResponse_ :: B.ByteString -> L.ByteString -> Response-toResponse_ contentType message =- let res = Response 200 M.empty nullRsFlags message Nothing- in setHeaderBS (B.pack "Content-Type") contentType res+ toResponse $ hamlet showFn
happstack-hamlet.cabal view
@@ -1,5 +1,5 @@ Name: happstack-hamlet-Version: 6.1.1+Version: 6.1.2 Synopsis: Support for Hamlet HTML templates in Happstack Description: Happstack is a web application development framework. @@ -25,10 +25,8 @@ Library Exposed-modules: Happstack.Server.Hamlet Build-depends: base >= 3 && <5,- bytestring,- containers, happstack-server >= 6.0 && < 6.3,- hamlet >= 0.8 && <0.9,+ hamlet >= 0.9 && <0.10, text -- Modules not exported by this package.