aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Shared.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-09-29 09:45:14 +0200
committerJohn MacFarlane <[email protected]>2022-09-30 08:33:40 -0700
commitddaadc88bc7e09fdff35fcf100a0f9fbe5d17728 (patch)
treebbddc6be332d8edcd5d78743b7ca259253bc07a3 /src/Text/Pandoc/Shared.hs
parente099de1d4d2f4ca865596a6608774c7c0940a0d9 (diff)
[API Change] Rename `pandocVersion` to `pandocVersionText`...
and add a new `pandocVersion` value with type `Version`. This is consistent with the type used for `pandocTypesVersion` and allows to use the value where a Version type is required.
Diffstat (limited to 'src/Text/Pandoc/Shared.hs')
-rw-r--r--src/Text/Pandoc/Shared.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index c71204339..f2bfea0ae 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -93,7 +93,8 @@ module Text.Pandoc.Shared (
-- * User data directory
defaultUserDataDir,
-- * Version
- pandocVersion
+ pandocVersion,
+ pandocVersionText
) where
import Codec.Archive.Zip
@@ -113,7 +114,7 @@ import Data.Monoid (Any (..))
import Data.Sequence (ViewL (..), ViewR (..), viewl, viewr)
import qualified Data.Set as Set
import qualified Data.Text as T
-import Data.Version (showVersion)
+import Data.Version (Version, showVersion)
import Network.URI (URI (uriScheme), escapeURIString, parseURI)
import Paths_pandoc (version)
import System.Directory
@@ -132,8 +133,12 @@ import Text.DocLayout (charWidth)
import Text.Pandoc.Walk
-- | Version number of pandoc library.
-pandocVersion :: T.Text
-pandocVersion = T.pack $ showVersion version
+pandocVersion :: Version
+pandocVersion = version
+
+-- | Text representation of the library's version number.
+pandocVersionText :: T.Text
+pandocVersionText = T.pack $ showVersion version
--
-- List processing