refresh patch
Odd, it should have been against 0.0.6 before, but fails to apply now
This commit is contained in:
parent
0ae140f584
commit
3eab72d13c
1 changed files with 11 additions and 29 deletions
|
@ -1,17 +1,17 @@
|
||||||
From 2b41af230ea5675592e87a2362d9c17bcd8df1db Mon Sep 17 00:00:00 2001
|
From 497d09a91f9eb1e5979948cd128078491b0e8bca Mon Sep 17 00:00:00 2001
|
||||||
From: dummy <dummy@example.com>
|
From: Joey Hess <joey@kitenet.net>
|
||||||
Date: Tue, 10 Jun 2014 19:00:44 +0000
|
Date: Fri, 12 Sep 2014 20:52:08 -0400
|
||||||
Subject: [PATCH] remove TH
|
Subject: [PATCH] remove TH
|
||||||
|
|
||||||
---
|
---
|
||||||
Data/FileEmbed.hs | 100 +++---------------------------------------------------
|
Data/FileEmbed.hs | 87 ++++---------------------------------------------------
|
||||||
1 file changed, 5 insertions(+), 95 deletions(-)
|
1 file changed, 5 insertions(+), 82 deletions(-)
|
||||||
|
|
||||||
diff --git a/Data/FileEmbed.hs b/Data/FileEmbed.hs
|
diff --git a/Data/FileEmbed.hs b/Data/FileEmbed.hs
|
||||||
index aae9d5a..efdbb7b 100644
|
index 5617493..adacdba 100644
|
||||||
--- a/Data/FileEmbed.hs
|
--- a/Data/FileEmbed.hs
|
||||||
+++ b/Data/FileEmbed.hs
|
+++ b/Data/FileEmbed.hs
|
||||||
@@ -17,19 +17,18 @@
|
@@ -17,13 +17,13 @@
|
||||||
-- > {-# LANGUAGE TemplateHaskell #-}
|
-- > {-# LANGUAGE TemplateHaskell #-}
|
||||||
module Data.FileEmbed
|
module Data.FileEmbed
|
||||||
( -- * Embed at compile time
|
( -- * Embed at compile time
|
||||||
|
@ -19,7 +19,7 @@ index aae9d5a..efdbb7b 100644
|
||||||
- , embedOneFileOf
|
- , embedOneFileOf
|
||||||
- , embedDir
|
- , embedDir
|
||||||
- , getDir
|
- , getDir
|
||||||
+ -- embedFile
|
+ -- embedFile
|
||||||
+ --, embedOneFileOf
|
+ --, embedOneFileOf
|
||||||
+ --, embedDir
|
+ --, embedDir
|
||||||
+ getDir
|
+ getDir
|
||||||
|
@ -30,13 +30,7 @@ index aae9d5a..efdbb7b 100644
|
||||||
#endif
|
#endif
|
||||||
, inject
|
, inject
|
||||||
, injectFile
|
, injectFile
|
||||||
-- * Internal
|
@@ -56,73 +56,12 @@ import Data.ByteString.Unsafe (unsafePackAddressLen)
|
||||||
, stringToBs
|
|
||||||
- , bsToExp
|
|
||||||
) where
|
|
||||||
|
|
||||||
import Language.Haskell.TH.Syntax
|
|
||||||
@@ -57,85 +56,12 @@ import Data.ByteString.Unsafe (unsafePackAddressLen)
|
|
||||||
import System.IO.Unsafe (unsafePerformIO)
|
import System.IO.Unsafe (unsafePerformIO)
|
||||||
import System.FilePath ((</>))
|
import System.FilePath ((</>))
|
||||||
|
|
||||||
|
@ -102,27 +96,15 @@ index aae9d5a..efdbb7b 100644
|
||||||
- return $! TupE [LitE $ StringL path, exp']
|
- return $! TupE [LitE $ StringL path, exp']
|
||||||
-
|
-
|
||||||
-bsToExp :: B.ByteString -> Q Exp
|
-bsToExp :: B.ByteString -> Q Exp
|
||||||
-#if MIN_VERSION_template_haskell(2, 5, 0)
|
|
||||||
-bsToExp bs =
|
|
||||||
- return $ VarE 'unsafePerformIO
|
|
||||||
- `AppE` (VarE 'unsafePackAddressLen
|
|
||||||
- `AppE` LitE (IntegerL $ fromIntegral $ B8.length bs)
|
|
||||||
-#if MIN_VERSION_template_haskell(2, 8, 0)
|
|
||||||
- `AppE` LitE (StringPrimL $ B.unpack bs))
|
|
||||||
-#else
|
|
||||||
- `AppE` LitE (StringPrimL $ B8.unpack bs))
|
|
||||||
-#endif
|
|
||||||
-#else
|
|
||||||
-bsToExp bs = do
|
-bsToExp bs = do
|
||||||
- helper <- [| stringToBs |]
|
- helper <- [| stringToBs |]
|
||||||
- let chars = B8.unpack bs
|
- let chars = B8.unpack bs
|
||||||
- return $! AppE helper $! LitE $! StringL chars
|
- return $! AppE helper $! LitE $! StringL chars
|
||||||
-#endif
|
|
||||||
-
|
-
|
||||||
stringToBs :: String -> B.ByteString
|
stringToBs :: String -> B.ByteString
|
||||||
stringToBs = B8.pack
|
stringToBs = B8.pack
|
||||||
|
|
||||||
@@ -177,22 +103,6 @@ padSize i =
|
@@ -164,22 +103,6 @@ padSize i =
|
||||||
let s = show i
|
let s = show i
|
||||||
in replicate (sizeLen - length s) '0' ++ s
|
in replicate (sizeLen - length s) '0' ++ s
|
||||||
|
|
||||||
|
@ -146,5 +128,5 @@ index aae9d5a..efdbb7b 100644
|
||||||
inject :: B.ByteString -- ^ bs to inject
|
inject :: B.ByteString -- ^ bs to inject
|
||||||
-> B.ByteString -- ^ original BS containing dummy
|
-> B.ByteString -- ^ original BS containing dummy
|
||||||
--
|
--
|
||||||
2.0.0
|
2.1.0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue