Skip to content

Commit df2d395

Browse files
committed
Add comment about split/splitGen deprecation in fusion benchmark
Co-authored-by: Simon Jakobi <simon.jakobi@gmail.com> Assisted-by: Claude (accounts/fireworks/models/glm-5[1m])
1 parent 7decab8 commit df2d395

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

prettyprinter/bench/Fusion.hs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ import Prettyprinter
1818
import Prettyprinter.Render.Text
1919
import qualified Text.PrettyPrint.ANSI.Leijen as WL
2020

21-
#if !(APPLICATIVE_MONAD)
22-
import Control.Applicative
23-
#endif
24-
2521

2622

2723
main :: IO ()
@@ -47,12 +43,14 @@ benchOptimize = env randomShortWords benchmark_
4743
randomShortWords' :: Int -> State StdGen [Text]
4844
randomShortWords' n = replicateM n randomShortWord
4945

46+
-- Note: 'split' is deprecated in random >= 1.2 in favor of 'splitGen'.
47+
-- We could use 'splitGen' when support for GHC < 9.0 is dropped.
5048
randomShortWord :: State StdGen Text
5149
randomShortWord = do
5250
g <- get
5351
let (l, g') = randomR (0, 5) g
5452
(gNew, gFree) = split g'
55-
xs = take l (randoms gFree)
53+
xs = take l (randoms gFree :: [Char])
5654
put gNew
5755
pure (T.pack xs)
5856

0 commit comments

Comments
 (0)