summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasperVanDerJeugt <>2018-05-08 22:03:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-05-08 22:03:00 (GMT)
commitc6719628df75bf00aa92d61ac0f0d1da633ae4ee (patch)
tree57e87d8af07f5342cd3c9f0567a9802b62dcf759
parent19d6d0967844002199ca13dbb0a5cb7c6582cf91 (diff)
version 0.7.2.00.7.2.0
-rw-r--r--CHANGELOG.md6
-rw-r--r--patat.cabal10
-rw-r--r--src/Patat/Presentation/Internal.hs21
-rw-r--r--src/Patat/PrettyPrint.hs7
-rw-r--r--src/Patat/Theme.hs34
5 files changed, 49 insertions, 29 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 873b3b8..ab57bc6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,11 @@
# Changelog
+- 0.7.2.0 (2018-05-08)
+ * GHC 8.4 compatibility
+
+- 0.7.1.0 (2018-05-08)
+ * GHC 8.4 compatibility
+
- 0.7.0.0 (2018-05-04)
* Support HTML-style comments
diff --git a/patat.cabal b/patat.cabal
index 56a352d..c33acde 100644
--- a/patat.cabal
+++ b/patat.cabal
@@ -1,5 +1,5 @@
Name: patat
-Version: 0.7.0.0
+Version: 0.7.2.0
Synopsis: Terminal-based presentations using Pandoc
Description: Terminal-based presentations using Pandoc
License: GPL-2
@@ -35,7 +35,7 @@ Executable patat
aeson >= 0.9 && < 1.4,
ansi-terminal >= 0.6 && < 0.9,
ansi-wl-pprint >= 0.6 && < 0.7,
- base >= 4.6 && < 4.11,
+ base >= 4.6 && < 5,
bytestring >= 0.10 && < 0.11,
containers >= 0.5 && < 0.6,
directory >= 1.2 && < 1.4,
@@ -54,6 +54,10 @@ Executable patat
network-uri >= 2.6,
network >= 2.6
+ If impl(ghc < 8.0)
+ Build-depends:
+ semigroups >= 0.16 && < 0.19
+
Other-modules:
Data.Aeson.Extended
Data.Aeson.TH.Extended
@@ -84,7 +88,7 @@ Executable patat-make-man
Buildable: False
Build-depends:
- base >= 4.6 && < 4.11,
+ base >= 4.6 && < 5,
mtl >= 2.2 && < 2.3,
pandoc >= 2.0 && < 2.3,
text >= 1.2 && < 1.3,
diff --git a/src/Patat/Presentation/Internal.hs b/src/Patat/Presentation/Internal.hs
index 3ed7ac0..a44ae1d 100644
--- a/src/Patat/Presentation/Internal.hs
+++ b/src/Patat/Presentation/Internal.hs
@@ -29,7 +29,8 @@ import qualified Data.Aeson.TH.Extended as A
import qualified Data.Foldable as Foldable
import Data.List (intercalate)
import Data.Maybe (listToMaybe)
-import Data.Monoid (Monoid (..), (<>))
+import Data.Monoid (Monoid (..))
+import Data.Semigroup (Semigroup (..))
import qualified Data.Text as T
import qualified Patat.Theme as Theme
import Prelude
@@ -64,11 +65,8 @@ data PresentationSettings = PresentationSettings
--------------------------------------------------------------------------------
-instance Monoid PresentationSettings where
- mempty = PresentationSettings
- Nothing Nothing Nothing Nothing Nothing Nothing Nothing
- Nothing
- mappend l r = PresentationSettings
+instance Semigroup PresentationSettings where
+ l <> r = PresentationSettings
{ psRows = psRows l `mplus` psRows r
, psColumns = psColumns l `mplus` psColumns r
, psWrap = psWrap l `mplus` psWrap r
@@ -79,6 +77,13 @@ instance Monoid PresentationSettings where
, psPandocExtensions = psPandocExtensions l `mplus` psPandocExtensions r
}
+--------------------------------------------------------------------------------
+instance Monoid PresentationSettings where
+ mappend = (<>)
+ mempty = PresentationSettings
+ Nothing Nothing Nothing Nothing Nothing Nothing Nothing
+ Nothing
+
--------------------------------------------------------------------------------
defaultPresentationSettings :: PresentationSettings
@@ -123,7 +128,7 @@ instance A.FromJSON ExtensionList where
--------------------------------------------------------------------------------
defaultExtensionList :: ExtensionList
defaultExtensionList = ExtensionList $
- Pandoc.readerExtensions Pandoc.def <> Pandoc.extensionsFromList
+ Pandoc.readerExtensions Pandoc.def `mappend` Pandoc.extensionsFromList
[ Pandoc.Ext_yaml_metadata_block
, Pandoc.Ext_table_captions
, Pandoc.Ext_simple_tables
@@ -156,7 +161,7 @@ data Slide
--------------------------------------------------------------------------------
newtype Fragment = Fragment {unFragment :: [Pandoc.Block]}
- deriving (Monoid, Show)
+ deriving (Monoid, Semigroup, Show)
--------------------------------------------------------------------------------
diff --git a/src/Patat/PrettyPrint.hs b/src/Patat/PrettyPrint.hs
index 7b24b37..eb52b02 100644
--- a/src/Patat/PrettyPrint.hs
+++ b/src/Patat/PrettyPrint.hs
@@ -45,13 +45,14 @@ import Control.Monad.State (get, gets, modify)
import Control.Monad.Writer (tell)
import Data.Foldable (Foldable)
import qualified Data.List as L
-import Data.Monoid (Monoid, mconcat, mempty, (<>))
+import Data.Monoid (Monoid, mconcat, mempty)
+import Data.Semigroup (Semigroup (..))
import Data.String (IsString (..))
import qualified Data.Text as T
import Data.Traversable (Traversable, traverse)
+import Prelude hiding (null)
import qualified System.Console.ANSI as Ansi
import qualified System.IO as IO
-import Prelude hiding (null)
--------------------------------------------------------------------------------
@@ -130,7 +131,7 @@ chunkToDocE (StringChunk codes str) = Ansi (\_ -> codes) (Doc [String str])
--------------------------------------------------------------------------------
newtype Doc = Doc {unDoc :: [DocE]}
- deriving (Monoid)
+ deriving (Monoid, Semigroup)
--------------------------------------------------------------------------------
diff --git a/src/Patat/Theme.hs b/src/Patat/Theme.hs
index d01a71a..5d383a9 100644
--- a/src/Patat/Theme.hs
+++ b/src/Patat/Theme.hs
@@ -22,7 +22,8 @@ import Data.Char (toLower, toUpper)
import Data.List (intercalate, isSuffixOf)
import qualified Data.Map as M
import Data.Maybe (mapMaybe, maybeToList)
-import Data.Monoid (Monoid (..), (<>))
+import Data.Monoid (Monoid (..))
+import Data.Semigroup (Semigroup (..))
import qualified Data.Text as T
import Prelude
import qualified Skylighting as Skylighting
@@ -59,13 +60,8 @@ data Theme = Theme
--------------------------------------------------------------------------------
-instance Monoid Theme where
- mempty = Theme
- Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
- Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
- Nothing Nothing Nothing Nothing Nothing
-
- mappend l r = Theme
+instance Semigroup Theme where
+ l <> r = Theme
{ themeBorders = mplusOn themeBorders
, themeHeader = mplusOn themeHeader
, themeCodeBlock = mplusOn themeCodeBlock
@@ -96,11 +92,19 @@ instance Monoid Theme where
--------------------------------------------------------------------------------
+instance Monoid Theme where
+ mappend = (<>)
+ mempty = Theme
+ Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
+ Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing Nothing
+ Nothing Nothing Nothing Nothing Nothing
+
+--------------------------------------------------------------------------------
defaultTheme :: Theme
defaultTheme = Theme
{ themeBorders = dull Ansi.Yellow
, themeHeader = dull Ansi.Blue
- , themeCodeBlock = dull Ansi.White <> ondull Ansi.Black
+ , themeCodeBlock = dull Ansi.White `mappend` ondull Ansi.Black
, themeBulletList = dull Ansi.Magenta
, themeBulletListMarkers = Just "-*"
, themeOrderedList = dull Ansi.Magenta
@@ -111,15 +115,15 @@ defaultTheme = Theme
, themeTableSeparator = dull Ansi.Magenta
, themeLineBlock = dull Ansi.Magenta
, themeEmph = dull Ansi.Green
- , themeStrong = dull Ansi.Red <> bold
- , themeCode = dull Ansi.White <> ondull Ansi.Black
+ , themeStrong = dull Ansi.Red `mappend` bold
+ , themeCode = dull Ansi.White `mappend` ondull Ansi.Black
, themeLinkText = dull Ansi.Green
- , themeLinkTarget = dull Ansi.Cyan <> underline
+ , themeLinkTarget = dull Ansi.Cyan `mappend` underline
, themeStrikeout = ondull Ansi.Red
, themeQuoted = dull Ansi.Green
, themeMath = dull Ansi.Green
, themeImageText = dull Ansi.Green
- , themeImageTarget = dull Ansi.Cyan <> underline
+ , themeImageTarget = dull Ansi.Cyan `mappend` underline
, themeSyntaxHighlighting = Just defaultSyntaxHighlighting
}
where
@@ -131,7 +135,7 @@ defaultTheme = Theme
--------------------------------------------------------------------------------
newtype Style = Style {unStyle :: [Ansi.SGR]}
- deriving (Monoid, Show)
+ deriving (Monoid, Semigroup, Show)
--------------------------------------------------------------------------------
@@ -202,7 +206,7 @@ sgrsByName = M.fromList
--------------------------------------------------------------------------------
newtype SyntaxHighlighting = SyntaxHighlighting
{ unSyntaxHighlighting :: M.Map String Style
- } deriving (Monoid, Show, A.ToJSON)
+ } deriving (Monoid, Semigroup, Show, A.ToJSON)
--------------------------------------------------------------------------------