aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pandoc.cabal16
-rw-r--r--src/Text/Pandoc/Class.hs4
-rw-r--r--src/Text/Pandoc/Compat/Time.hs30
-rw-r--r--src/Text/Pandoc/Readers/Txt2Tags.hs2
-rw-r--r--src/Text/Pandoc/Shared.hs9
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs2
-rw-r--r--src/Text/Pandoc/Writers/EPUB.hs2
-rw-r--r--src/Text/Pandoc/Writers/OPML.hs9
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint/Output.hs2
-rw-r--r--src/Text/Pandoc/Writers/Powerpoint/Presentation.hs2
-rw-r--r--stack.lts9.yaml1
-rw-r--r--stack.yaml1
12 files changed, 12 insertions, 68 deletions
diff --git a/pandoc.cabal b/pandoc.cabal
index 3f7432aa6..5b3fe57a4 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -343,10 +343,6 @@ flag network-uri
Description: Get Network.URI from the network-uri package
Default: True
-flag old-locale
- Description: Use old-locale and time < 1.5
- Default: False
-
custom-setup
setup-depends: base, Cabal
@@ -363,6 +359,7 @@ library
directory >= 1 && < 1.4,
bytestring >= 0.9 && < 0.11,
text >= 0.11 && < 1.3,
+ time >= 1.5 && < 1.10,
safe >= 0.3 && < 0.4,
zip-archive >= 0.2.3.4 && < 0.4,
HTTP >= 4000.0.5 && < 4000.4,
@@ -408,11 +405,6 @@ library
cpp-options: -D_WINDOWS
else
build-depends: unix >= 2.4 && < 2.8
- if flag(old-locale)
- build-depends: old-locale >= 1 && < 1.1,
- time >= 1.2 && < 1.5
- else
- build-depends: time >= 1.5 && < 1.10
if flag(network-uri)
build-depends: network-uri >= 2.6 && < 2.7, network >= 2.6
else
@@ -556,7 +548,6 @@ library
Text.Pandoc.UUID,
Text.Pandoc.Translations,
Text.Pandoc.Slides,
- Text.Pandoc.Compat.Time,
Paths_pandoc
buildable: True
@@ -652,11 +643,6 @@ test-suite test-pandoc
hs-source-dirs: prelude
other-modules: Prelude
build-depends: base-compat >= 0.9
- if flag(old-locale)
- build-depends: old-locale >= 1 && < 1.1,
- time >= 1.2 && < 1.5
- else
- build-depends: time >= 1.5 && < 1.10
other-modules: Tests.Old
Tests.Command
Tests.Helpers
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs
index 62341ba16..c78822ee9 100644
--- a/src/Text/Pandoc/Class.hs
+++ b/src/Text/Pandoc/Class.hs
@@ -108,10 +108,10 @@ import Data.List (stripPrefix)
import qualified Data.Unique as IO (newUnique)
import qualified Text.Pandoc.UTF8 as UTF8
import qualified System.Directory as Directory
-import Text.Pandoc.Compat.Time (UTCTime)
+import Data.Time (UTCTime)
import Text.Pandoc.Logging
import Text.Parsec (ParsecT, getPosition, sourceLine, sourceName)
-import qualified Text.Pandoc.Compat.Time as IO (getCurrentTime)
+import qualified Data.Time as IO (getCurrentTime)
import Text.Pandoc.MIME (MimeType, getMimeType, extensionFromMimeType)
import Text.Pandoc.Definition
import Data.Digest.Pure.SHA (sha1, showDigest)
diff --git a/src/Text/Pandoc/Compat/Time.hs b/src/Text/Pandoc/Compat/Time.hs
deleted file mode 100644
index b1cde82a4..000000000
--- a/src/Text/Pandoc/Compat/Time.hs
+++ /dev/null
@@ -1,30 +0,0 @@
-{-# LANGUAGE CPP #-}
-
-{-
-This compatibility module is needed because, in time 1.5, the
-`defaultTimeLocale` function was moved from System.Locale (in the
-old-locale library) into Data.Time.
-
-We support both behaviors because time 1.4 is a boot library for GHC
-7.8. time 1.5 is a boot library for GHC 7.10.
-
-When support is dropped for GHC 7.8, this module may be obsoleted.
--}
-
-#if MIN_VERSION_time(1,5,0)
-module Text.Pandoc.Compat.Time (
- module Data.Time
-)
-where
-import Data.Time
-
-#else
-module Text.Pandoc.Compat.Time (
- module Data.Time,
- defaultTimeLocale
-)
-where
-import Data.Time
-import System.Locale ( defaultTimeLocale )
-
-#endif
diff --git a/src/Text/Pandoc/Readers/Txt2Tags.hs b/src/Text/Pandoc/Readers/Txt2Tags.hs
index deac904b7..bed49fd46 100644
--- a/src/Text/Pandoc/Readers/Txt2Tags.hs
+++ b/src/Text/Pandoc/Readers/Txt2Tags.hs
@@ -47,7 +47,7 @@ import Text.Pandoc.Builder (Blocks, Inlines, trimInlines)
import qualified Text.Pandoc.Builder as B
import Text.Pandoc.Class (PandocMonad)
import qualified Text.Pandoc.Class as P
-import Text.Pandoc.Compat.Time (defaultTimeLocale)
+import Data.Time (defaultTimeLocale)
import Text.Pandoc.Definition
import Text.Pandoc.Options
import Text.Pandoc.Parsing hiding (space, spaces, uri)
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index eb3addc43..8b1af19cd 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -127,7 +127,7 @@ import Text.HTML.TagSoup (RenderOptions (..), Tag (..), renderOptions,
renderTagsOptions)
import Text.Pandoc.Builder (Blocks, Inlines, ToMetaValue (..))
import qualified Text.Pandoc.Builder as B
-import Text.Pandoc.Compat.Time
+import Data.Time
import Text.Pandoc.Definition
import Text.Pandoc.Generic (bottomUp)
import Text.Pandoc.Pretty (charWidth)
@@ -287,12 +287,7 @@ normalizeDate s = fmap (formatTime defaultTimeLocale "%F")
where rejectBadYear day = case toGregorian day of
(y, _, _) | y >= 1601 && y <= 9999 -> Just day
_ -> Nothing
- parsetimeWith =
-#if MIN_VERSION_time(1,5,0)
- parseTimeM True defaultTimeLocale
-#else
- parseTime defaultTimeLocale
-#endif
+ parsetimeWith = parseTimeM True defaultTimeLocale
formats = ["%x","%m/%d/%Y", "%D","%F", "%d %b %Y",
"%e %B %Y", "%b. %e, %Y", "%B %e, %Y",
"%Y%m%d", "%Y%m", "%Y"]
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index 82af18f7c..9b65e6ec7 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -53,7 +53,7 @@ import System.Random (randomR, StdGen, mkStdGen)
import Text.Pandoc.BCP47 (getLang, renderLang)
import Text.Pandoc.Class (PandocMonad, report, toLang)
import qualified Text.Pandoc.Class as P
-import Text.Pandoc.Compat.Time
+import Data.Time
import Text.Pandoc.Definition
import Text.Pandoc.Generic
import Text.Pandoc.Highlighting (highlight)
diff --git a/src/Text/Pandoc/Writers/EPUB.hs b/src/Text/Pandoc/Writers/EPUB.hs
index 1dab2e627..e74e5e0c3 100644
--- a/src/Text/Pandoc/Writers/EPUB.hs
+++ b/src/Text/Pandoc/Writers/EPUB.hs
@@ -55,7 +55,7 @@ import Text.HTML.TagSoup (Tag (TagOpen), fromAttrib, parseTags)
import Text.Pandoc.Builder (fromList, setMeta)
import Text.Pandoc.Class (PandocMonad, report)
import qualified Text.Pandoc.Class as P
-import Text.Pandoc.Compat.Time
+import Data.Time
import Text.Pandoc.Definition
import Text.Pandoc.Error
import Text.Pandoc.Logging
diff --git a/src/Text/Pandoc/Writers/OPML.hs b/src/Text/Pandoc/Writers/OPML.hs
index c081b957e..6c48046a2 100644
--- a/src/Text/Pandoc/Writers/OPML.hs
+++ b/src/Text/Pandoc/Writers/OPML.hs
@@ -36,7 +36,7 @@ import Data.Text (Text, unpack)
import qualified Data.Text as T
import qualified Text.Pandoc.Builder as B
import Text.Pandoc.Class (PandocMonad)
-import Text.Pandoc.Compat.Time
+import Data.Time
import Text.Pandoc.Definition
import Text.Pandoc.Error
import Text.Pandoc.Options
@@ -77,12 +77,7 @@ showDateTimeRFC822 = formatTime defaultTimeLocale "%a, %d %b %Y %X %Z"
convertDate :: [Inline] -> String
convertDate ils = maybe "" showDateTimeRFC822 $
-#if MIN_VERSION_time(1,5,0)
- parseTimeM True
-#else
- parseTime
-#endif
- defaultTimeLocale "%F" =<< normalizeDate (stringify ils)
+ parseTimeM True defaultTimeLocale "%F" =<< normalizeDate (stringify ils)
-- | Convert an Element to OPML.
elementToOPML :: PandocMonad m => WriterOptions -> Element -> m Doc
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Output.hs b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
index 2ece78c01..8cb848ea6 100644
--- a/src/Text/Pandoc/Writers/Powerpoint/Output.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Output.hs
@@ -43,7 +43,7 @@ import Codec.Archive.Zip
import Data.Char (toUpper)
import Data.List (intercalate, stripPrefix, nub, union, isPrefixOf, intersperse)
import Data.Default
-import Text.Pandoc.Compat.Time (formatTime, defaultTimeLocale)
+import Data.Time (formatTime, defaultTimeLocale)
import Data.Time.Clock (UTCTime)
import Data.Time.Clock.POSIX (utcTimeToPOSIXSeconds, posixSecondsToUTCTime)
import System.FilePath.Posix (splitDirectories, splitExtension, takeExtension)
diff --git a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
index ac6001d2b..4f8a0908b 100644
--- a/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
+++ b/src/Text/Pandoc/Writers/Powerpoint/Presentation.hs
@@ -69,7 +69,7 @@ import Text.Pandoc.Slides (getSlideLevel)
import Text.Pandoc.Options
import Text.Pandoc.Logging
import Text.Pandoc.Walk
-import Text.Pandoc.Compat.Time (UTCTime)
+import Data.Time (UTCTime)
import qualified Text.Pandoc.Shared as Shared -- so we don't overlap "Element"
import Text.Pandoc.Writers.Shared (metaValueToInlines)
import qualified Data.Map as M
diff --git a/stack.lts9.yaml b/stack.lts9.yaml
index cea5305ac..ecaade32e 100644
--- a/stack.lts9.yaml
+++ b/stack.lts9.yaml
@@ -2,7 +2,6 @@ flags:
pandoc:
trypandoc: false
embed_data_files: true
- old-locale: false
network-uri: true
pandoc-citeproc:
bibutils: true
diff --git a/stack.yaml b/stack.yaml
index 4add3e6a6..60bd7a873 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -2,7 +2,6 @@ flags:
pandoc:
trypandoc: false
embed_data_files: true
- old-locale: false
network-uri: true
pandoc-citeproc:
bibutils: true