packages feed

mustache 0.3.0.0 → 0.3.0.1

raw patch · 2 files changed

+25/−30 lines, 2 files

Files

mustache.cabal view
@@ -1,11 +1,15 @@ name:                mustache-version:             0.3.0.0+version:             0.3.0.1 synopsis:            A mustache template parser library. description:   Allows parsing and rendering template files with mustache markup. See the   mustache <http://mustache.github.io/mustache.5.html language reference>.    Implements the mustache spec version 1.1.3++  This library requires GHC >= 7.10 because it uses the new overlapping instances+  to provide eficcient and versatile conversion of custom data types into mustache+  Values. license:             BSD3 license-file:        LICENSE author:              Justus Adam@@ -17,7 +21,7 @@ build-type:          Simple extra-source-files:  README.md cabal-version:       >=1.10-tested-with:         GHC >=7.8 && <= 7.10.2+tested-with:         GHC >=7.10 && <= 7.10.2   source-repository head@@ -28,7 +32,7 @@   type:     git   branch:   master   location: git://github.com/JustusAdam/mustache.git-  tag:      v0.3.0.0rc-1+  tag:      v0.3.0.1rc-2   
src/lib/Text/Mustache/Types.hs view
@@ -110,7 +110,7 @@ instance ToMustache Value where   toMustache = id -instance ToMustache [Char] where+instance {-# OVERLAPPING #-} ToMustache [Char] where   toMustache = toMustache ∘ pack  instance ToMustache Bool where@@ -131,22 +131,17 @@ instance ToMustache Scientific where   toMustache = Number -instance ToMustache ω ⇒ ToMustache [ω] where+instance {-# OVERLAPPABLE #-} ToMustache ω ⇒ ToMustache [ω] where   toMustache = Array ∘ V.fromList ∘ fmap toMustache --- TODO Add these back in when you find a way to do so on earlier GHC versions--- or you drop support for GHC < 7.10--- instance {-# OVERLAPPING #-} ToMustache (V.Vector Value) where---   toMustache = Array+instance {-# OVERLAPPING #-} ToMustache (V.Vector Value) where+  toMustache = Array  instance ToMustache ω ⇒ ToMustache (V.Vector ω) where   toMustache = toMustache ∘ fmap toMustache --- TODO Add these back in when you find a way to do so on earlier GHC versions--- or you drop support for GHC < 7.10--- instance {-# OVERLAPPING #-} ToMustache (HM.HashMap Text Value) where---   toMustache = Object-+instance {-# OVERLAPPING #-} ToMustache (HM.HashMap Text Value) where+  toMustache = Object  instance (Conversion θ Text, ToMustache ω) ⇒ ToMustache (Map.Map θ ω) where   toMustache =@@ -158,14 +153,12 @@ instance ToMustache ω ⇒ ToMustache (HM.HashMap Text ω) where   toMustache = toMustache ∘ fmap toMustache -  -- TODO Add these back in when you find a way to do so on earlier GHC versions-  -- or you drop support for GHC < 7.10--- instance (Conversion θ Text, ToMustache ω) ⇒ ToMustache (HM.HashMap θ ω) where---   toMustache =---     toMustache---     ∘ HM.foldrWithKey---       (\k → HM.insert (convert k ∷ Text) ∘ toMustache)---       HM.empty+instance {-# OVERLAPPABLE #-} (Conversion θ Text, ToMustache ω) ⇒ ToMustache (HM.HashMap θ ω) where+  toMustache =+    toMustache+    ∘ HM.foldrWithKey+      (\k → HM.insert (convert k ∷ Text) ∘ toMustache)+      HM.empty  instance ToMustache (Context Value → AST → AST) where   toMustache = Lambda@@ -176,14 +169,12 @@       wrapper ∷ Context Value → AST → AST       wrapper c lAST = return ∘ TextBlock $ f c lAST --- TODO Add these back in when you find a way to do so on earlier GHC versions--- or you drop support for GHC < 7.10--- instance {-# OVERLAPPABLE #-} Conversion θ Text---   ⇒ ToMustache (Context Value → AST → θ) where---   toMustache f = toMustache wrapper---     where---       wrapper :: Context Value → AST → Text---       wrapper c = convert ∘ f c+instance {-# OVERLAPPABLE #-} Conversion θ Text+  ⇒ ToMustache (Context Value → AST → θ) where+  toMustache f = toMustache wrapper+    where+      wrapper :: Context Value → AST → Text+      wrapper c = convert ∘ f c  instance ToMustache (AST → AST) where   toMustache f = toMustache (const f ∷ Context Value → AST → AST)