aboutsummaryrefslogtreecommitdiff
path: root/benchmark/weigh-pandoc.hs
diff options
context:
space:
mode:
Diffstat (limited to 'benchmark/weigh-pandoc.hs')
-rw-r--r--benchmark/weigh-pandoc.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/benchmark/weigh-pandoc.hs b/benchmark/weigh-pandoc.hs
index f633255df..3b8a414aa 100644
--- a/benchmark/weigh-pandoc.hs
+++ b/benchmark/weigh-pandoc.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE NoImplicitPrelude #-}
+{-# LANGUAGE OverloadedStrings #-}
{- |
Module : Main
Copyright : © 2016-2019 John MacFarlane <jgm@berkeley.edu>
@@ -13,7 +14,7 @@ Benchmarks to determine resource use of readers and writers.
import Prelude
import Weigh
import Text.Pandoc
-import Data.Text (Text)
+import Data.Text (Text, unpack)
main :: IO ()
main = do
@@ -40,12 +41,12 @@ main = do
weighWriter :: Pandoc -> String -> (Pandoc -> Text) -> Weigh ()
weighWriter doc name writer = func (name ++ " writer") writer doc
-weighReader :: Pandoc -> String -> (Text -> Pandoc) -> Weigh ()
+weighReader :: Pandoc -> Text -> (Text -> Pandoc) -> Weigh ()
weighReader doc name reader = do
case lookup name writers of
Just (TextWriter writer) ->
let inp = either (error . show) id $ runPure $ writer def{ writerWrapText = WrapAuto} doc
- in func (name ++ " reader") reader inp
+ in func (unpack $ name <> " reader") reader inp
_ -> return () -- no writer for reader