packages feed

servant-blaze 0.8 → 0.9.1

raw patch · 3 files changed

Files

+ CHANGELOG.md view
@@ -0,0 +1,8 @@+# 0.9++- Also accept content type without character set i.e `text/html`+- Support only GHC >= 8.0++# 0.8++- Only single `MimeRender HTML a` instance. `blaze-markup` has `ToMarkup Markup` instance.
servant-blaze.cabal view
@@ -1,25 +1,24 @@+cabal-version:       >=1.10 name:                servant-blaze-version:             0.8+version:             0.9.1+ synopsis:            Blaze-html support for servant+category:            Servant, Web description:   Servant support for blaze-html   .   'HTML' content type which will use `ToMarkup` class.+ homepage:            http://haskell-servant.readthedocs.org/+bug-reports:         http://github.com/haskell-servant/servant-blaze/issues license:             BSD3 license-file:        LICENSE author:              Servant Contributors maintainer:          haskell-servant-maintainers@googlegroups.com-copyright:           2015-2016 Servant Contributors-category:            Web, Servant+copyright:           2015-2018 Servant Contributors build-type:          Simple-cabal-version:       >=1.10-bug-reports:         http://github.com/haskell-servant/servant-blaze/issues-tested-with:-  GHC==7.8.4,-  GHC==7.10.3,-  GHC==8.0.2,-  GHC==8.2.2+tested-with: GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.2+extra-source-files: CHANGELOG.md  source-repository head   type: git@@ -27,9 +26,9 @@  library   exposed-modules:     Servant.HTML.Blaze-  build-depends:       base       >=4.7     && <5-                     , servant    >=0.7     && <0.14-                     , http-media >=0.6.4   && <0.8+  build-depends:       base       >=4.9     && <5+                     , servant    >=0.10    && <0.19+                     , http-media >=0.6.4   && <0.9                      , blaze-html >=0.9.0.1 && <0.10   hs-source-dirs:      src   default-language:    Haskell2010@@ -45,7 +44,7 @@       base     , blaze-html     , servant-blaze-    , servant-server >=0.4.4.5  && <0.14+    , servant-server >=0.4.4.5  && <0.19     , wai            >=3.0.3.0  && <3.3-    , warp           >=3.0.13.1 && <3.3+    , warp           >=3.0.13.1 && <3.4   default-language: Haskell2010
src/Servant/HTML/Blaze.hs view
@@ -6,8 +6,8 @@  -- | An @HTML@ empty data type with `MimeRender` instances for @blaze-html@'s -- `ToMarkup` class and `Html` datatype.--- You should only need to import this module for it's instances and the--- `HTML` datatype.:+-- You should only need to import this module for its instances and the+-- `HTML` datatype: -- -- >>> type Eg = Get '[HTML] a --@@ -19,12 +19,15 @@ import           Servant.API                   (Accept (..), MimeRender (..)) import           Text.Blaze.Html               (Html, ToMarkup, toHtml) import           Text.Blaze.Html.Renderer.Utf8 (renderHtml)+import qualified Data.List.NonEmpty            as NE  data HTML deriving Typeable  -- | @text/html;charset=utf-8@ instance Accept HTML where-    contentType _ = "text" M.// "html" M./: ("charset", "utf-8")+    contentTypes _ =+      "text" M.// "html" M./: ("charset", "utf-8") NE.:|+      ["text" M.// "html"]  instance ToMarkup a => MimeRender HTML a where     mimeRender _ = renderHtml . toHtml