Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed to compile with GHC 6.12.

System.IO.UTF8 is imported conditionally for earlier versions.
  • Loading branch information...
commit 2c8eee0d5246304b4bcb97b22f404a5797acc324 1 parent b32fe9f
John MacFarlane authored
8 Yst/Build.hs
View
@@ -28,9 +28,15 @@ import System.FilePath
import System.Directory
import System.Exit
import System.Time (ClockTime(..))
+-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
+-- So we use System.IO.UTF8 only if we have an earlier version
+#if MIN_VERSION_base(4,2,0)
+import System.IO (hPutStrLn)
+#else
+import Prelude hiding (readFile, putStrLn, print, writeFile)
import System.IO.UTF8
+#endif
import System.IO (stderr)
-import Prelude hiding (readFile, putStrLn, print, writeFile)
import Control.Monad
dependencies :: Site -> String -> [FilePath]
5 Yst/CSV.hs
View
@@ -21,8 +21,13 @@ where
import Yst.Types
import Yst.Util
import Text.CSV
+-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
+-- So we use System.IO.UTF8 only if we have an earlier version
+#if MIN_VERSION_base(4,2,0)
+#else
import Prelude hiding (readFile)
import System.IO.UTF8
+#endif
readCSVFile :: FilePath -> IO Node
readCSVFile f = catch (readFile f >>= return . csvToNode . parseCSV' f . stripBlanks)
7 Yst/Render.hs
View
@@ -30,8 +30,13 @@ import Data.List.Split (wordsBy)
import Text.StringTemplate
import Data.Maybe (fromMaybe)
import System.FilePath
-import System.IO.UTF8
+-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
+-- So we use System.IO.UTF8 only if we have an earlier version
+#if MIN_VERSION_base(4,2,0)
+#else
import Prelude hiding (readFile, putStrLn, print, writeFile)
+import System.IO.UTF8
+#endif
import Data.Time
import Control.Monad
6 Yst/Util.hs
View
@@ -22,7 +22,13 @@ import Yst.Types
import System.Exit
import System.FilePath
import System.IO (stderr)
+-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
+-- So we use System.IO.UTF8 only if we have an earlier version
+#if MIN_VERSION_base(4,2,0)
+import System.IO (hPutStrLn)
+#else
import System.IO.UTF8 (hPutStrLn)
+#endif
import System.Directory
import Control.Monad
import Data.Time
4 yst.cabal
View
@@ -1,5 +1,6 @@
name: yst
-version: 0.2.2
+version: 0.2.2.1
+Tested-With: GHC == 6.10.4, GHC == 6.12.1
Cabal-version: >= 1.2
build-type: Simple
synopsis: Builds a static website from templates and data in YAML or
@@ -50,5 +51,6 @@ Executable yst
filepath, containers, directory, utf8-string, time,
old-locale, old-time, parsec, xhtml, pandoc, bytestring,
split
+ extensions: CPP
ghc-options: -Wall -threaded -fno-warn-orphans
ghc-prof-options: -auto-all -caf-all
8 yst.hs
View
@@ -26,9 +26,15 @@ import System.FilePath
import System.Environment
import System.Directory
import System.Exit
+-- Note: ghc >= 6.12 (base >=4.2) supports unicode through iconv
+-- So we use System.IO.UTF8 only if we have an earlier version
+#if MIN_VERSION_base(4,2,0)
+import System.IO (hPutStrLn)
+#else
+import Prelude hiding (readFile, putStrLn, print, writeFile)
import System.IO.UTF8
+#endif
import System.IO (stderr)
-import Prelude hiding (readFile, putStrLn, print, writeFile)
import Control.Monad
createSite :: FilePath -> IO ()
Please sign in to comment.
Something went wrong with that request. Please try again.