aboutsummaryrefslogtreecommitdiff
path: root/benchmark
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-06-10 21:10:52 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-06-10 21:10:52 +0200
commit25bfa26554a0236ce21cef036609651cdcbc44aa (patch)
tree79f157360abe63af2e6dad89765b61a70719edd9 /benchmark
parentf43504f9f4cad4368ea9e8834d97f3ad87ac1494 (diff)
downloadpandoc-25bfa26554a0236ce21cef036609651cdcbc44aa.tar.gz
Fixed weigh-pandoc for Text readers.
Diffstat (limited to 'benchmark')
-rw-r--r--benchmark/weigh-pandoc.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/benchmark/weigh-pandoc.hs b/benchmark/weigh-pandoc.hs
index b4462d747..35296f925 100644
--- a/benchmark/weigh-pandoc.hs
+++ b/benchmark/weigh-pandoc.hs
@@ -1,5 +1,6 @@
import Weigh
import Text.Pandoc
+import Data.Text (Text, pack)
main :: IO ()
main = do
@@ -26,11 +27,11 @@ main = do
weighWriter :: Pandoc -> String -> (Pandoc -> String) -> Weigh ()
weighWriter doc name writer = func (name ++ " writer") writer doc
-weighReader :: Pandoc -> String -> (String -> Pandoc) -> Weigh ()
+weighReader :: Pandoc -> String -> (Text -> Pandoc) -> Weigh ()
weighReader doc name reader = do
case lookup name writers of
Just (StringWriter writer) ->
- let inp = either (error . show) id $ runPure $ writer def{ writerWrapText = WrapAuto} doc
+ let inp = either (error . show) pack $ runPure $ writer def{ writerWrapText = WrapAuto} doc
in func (name ++ " reader") reader inp
_ -> return () -- no writer for reader