summaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-09-08 06:36:28 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2008-09-08 06:36:28 +0000
commit000b89c718fdef3790a56fad9cbbfcdcf7fbea52 (patch)
tree9603419213adad41e8b246a4ae660cf206d04e42 /Main.hs
parent2e893b43c4b0536957d46289e7f64b4943734bda (diff)
Use Data.List's 'intercalate' instead of custom 'joinWithSep'.
+ Removed joinWithSep definition from Text.Pandoc.Shared. + Replaced joinWithSep with intercalate + Depend on base >= 3, since in base < 3 intercalate is not included. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1428 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Main.hs b/Main.hs
index 0941d2548..7cf4e9970 100644
--- a/Main.hs
+++ b/Main.hs
@@ -32,7 +32,7 @@ writers.
module Main where
import Text.Pandoc
import Text.Pandoc.ODT
-import Text.Pandoc.Shared ( joinWithSep, HTMLMathMethod (..) )
+import Text.Pandoc.Shared ( HTMLMathMethod (..) )
import Text.Pandoc.Highlighting ( languages )
import System.Environment ( getArgs, getProgName, getEnvironment )
import System.Exit ( exitWith, ExitCode (..) )
@@ -40,6 +40,7 @@ import System.FilePath ( takeExtension, takeDirectory )
import System.Console.GetOpt
import Data.Maybe ( fromMaybe )
import Data.Char ( toLower )
+import Data.List ( intercalate )
import Prelude hiding ( putStrLn, writeFile, readFile, getContents )
import System.IO ( stdout, stderr )
import System.IO.UTF8
@@ -188,13 +189,13 @@ options =
(ReqArg
(\arg opt -> return opt { optReader = map toLower arg })
"FORMAT")
- "" -- ("(" ++ (joinWithSep ", " $ map fst readers) ++ ")")
+ "" -- ("(" ++ (intercalate ", " $ map fst readers) ++ ")")
, Option "tw" ["to","write"]
(ReqArg
(\arg opt -> return opt { optWriter = map toLower arg })
"FORMAT")
- "" -- ("(" ++ (joinWithSep ", " $ map fst writers) ++ ")")
+ "" -- ("(" ++ (intercalate ", " $ map fst writers) ++ ")")
, Option "s" ["standalone"]
(NoArg
@@ -389,8 +390,8 @@ options =
usageMessage :: String -> [OptDescr (Opt -> IO Opt)] -> String
usageMessage programName opts = usageInfo
(programName ++ " [OPTIONS] [FILES]" ++ "\nInput formats: " ++
- (joinWithSep ", " $ map fst readers) ++ "\nOutput formats: " ++
- (joinWithSep ", " $ map fst writers) ++ "\nOptions:")
+ (intercalate ", " $ map fst readers) ++ "\nOutput formats: " ++
+ (intercalate ", " $ map fst writers) ++ "\nOptions:")
opts
-- Determine default reader based on source file extensions
@@ -599,7 +600,7 @@ main = do
then putStrLn
else writeFile outputFile . (++ "\n")
- fmap (reader startParserState . tabFilter tabStop . joinWithSep "\n")
+ fmap (reader startParserState . tabFilter tabStop . intercalate "\n")
(readSources sources) >>=
#ifdef _CITEPROC
processBiblio cslFile refs >>=