Commit e19405e7 authored by Bodigrim's avatar Bodigrim
Browse files

Restore compatibility with ancient GHCs

parent 8aa259d7
......@@ -5,7 +5,7 @@
-- * Most pure functions defined the string types
--
{-# LANGUAGE BangPatterns, CPP, GADTs, MagicHash #-}
{-# LANGUAGE DeriveAnyClass, DeriveGeneric, RecordWildCards #-}
{-# LANGUAGE DeriveGeneric, RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Benchmarks.Pure
( initEnv
......@@ -51,8 +51,9 @@ data Env = Env
, tl :: [T.Text]
, tll :: [TL.Text]
, sl :: [String]
} deriving (Generic, NFData)
} deriving (Generic)
instance NFData Env
initEnv :: FilePath -> IO Env
initEnv fp = do
......@@ -299,7 +300,8 @@ benchmark kind ~Env{..} =
, benchTL $ nf TL.uncons tla
, benchBS $ nf BS.uncons bsa
, benchBSL $ nf BL.uncons bla
, benchS $ nf L.uncons sa
-- Old GHCs do not export L.uncons
, benchS $ nf (\xs -> case xs of [] -> Nothing; y : ys -> Just (y, ys)) sa
]
, bgroup "words"
[ benchT $ nf T.words ta
......
......@@ -6,7 +6,7 @@
-- * Most streaming functions
--
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveAnyClass, DeriveGeneric, RecordWildCards #-}
{-# LANGUAGE DeriveGeneric, RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Benchmarks.Stream
( initEnv
......@@ -55,7 +55,9 @@ data Env = Env
, utf32leL :: !BL.ByteString
, utf32beL :: !BL.ByteString
, s :: T.Stream Char
} deriving (Generic, NFData)
} deriving (Generic)
instance NFData Env
initEnv :: FilePath -> IO Env
initEnv fp = do
......
......@@ -252,6 +252,8 @@ benchmark text-benchmarks
ghc-options: -Wall -O2 -rtsopts
build-depends: base,
binary,
-- we need instance NFData ByteString
bytestring >= 0.10,
bytestring-lexing >= 0.5.0,
containers,
deepseq,
......@@ -296,7 +298,7 @@ benchmark text-benchmarks
default-language: Haskell2010
default-extensions: NondecreasingIndentation
other-extensions: DeriveAnyClass
other-extensions: DeriveGeneric
benchmark text-multilang
type: exitcode-stdio-1.0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment