@@ -14,7 +14,7 @@ module Data.FileEmbed
1414 ) where
1515
1616import Language.Haskell.TH.Syntax
17− ( Exp (AppE, ListE, LitE, TupE)
17+ ( Exp (AppE, ListE, LitE, TupE, SigE)
1818#if MIN_VERSION_template_haskell(2,5,0)
1919 , Lit (StringL, StringPrimL, IntegerL)
2020#else
@@ -57,7 +57,10 @@ embedFile fp =
5757-- > myDir :: [(FilePath, Data.ByteString.ByteString)]
5858-- > myDir = $(embedDir "dirName")
5959embedDir :: FilePath -> Q Exp
60−embedDir fp = ListE <$> ((runIO $ fileList fp) >>= mapM (pairToExp fp))
60+embedDir fp = do
61+ typ <- [t| [(FilePath, B.ByteString)] |]
62+ e <- ListE <$> ((runIO $ fileList fp) >>= mapM (pairToExp fp))
63+ return $ SigE e typ
6164
6265-- | Get a directory tree in the IO monad.
6366--