here 1.1 → 1.2
raw patch · 3 files changed
+12/−6 lines, 3 filesdep ~lensPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: lens
API changes (from Hackage documentation)
+ Data.String.Here.Uninterpolated: hereFile :: QuasiQuoter
Files
- here.cabal +2/−2
- src/Data/String/Here/Interpolated.hs +5/−3
- src/Data/String/Here/Uninterpolated.hs +5/−1
here.cabal view
@@ -1,5 +1,5 @@ name: here-version: 1.1+version: 1.2 synopsis: Here docs & interpolated strings via quasiquotation description: Here docs & interpolated strings via quasiquotation license: BSD3@@ -23,7 +23,7 @@ build-depends: base ==4.6.*, haskell-src-meta ==0.6.*,- lens ==3.8.*,+ lens >= 3.8 && < 3.10, mtl ==2.1.*, parsec ==3.1.*, template-haskell
src/Data/String/Here/Interpolated.hs view
@@ -9,6 +9,8 @@ import Control.Lens hiding (parts) import Data.Maybe+import Data.Monoid+import Data.String import Data.Typeable import Language.Haskell.Meta@@ -72,10 +74,10 @@ toExpQ (Esc c) = stringE [c] toExpQ (Anti expq) = [|toString $expq|] combine [] = stringE ""- combine parts = foldr1 (\subExpr acc -> [|$subExpr ++ $acc|]) parts+ combine parts = foldr1 (\subExpr acc -> [|$subExpr <> $acc|]) parts -toString :: (Show a, Typeable a) => a -> String-toString x = fromMaybe (show x) (cast x)+toString :: (Show a, Typeable a, IsString b) => a -> b+toString x = fromString $ fromMaybe (show x) (cast x) parseInterp :: String -> Either ParseError [StringPart] parseInterp = parse p_interp ""
src/Data/String/Here/Uninterpolated.hs view
@@ -1,7 +1,7 @@ {-# OPTIONS_GHC -fno-warn-missing-fields #-} -- | Literal, uninterpolated here docs-module Data.String.Here.Uninterpolated (here, hereLit) where+module Data.String.Here.Uninterpolated (here, hereFile, hereLit) where import Language.Haskell.TH import Language.Haskell.TH.Quote@@ -15,3 +15,7 @@ -- | Quote a here doc literally, with no whitespace stripping hereLit :: QuasiQuoter hereLit = QuasiQuoter {quoteExp = stringE}++-- | Splice a file's contents as a here doc+hereFile :: QuasiQuoter+hereFile = quoteFile hereLit