File tree Expand file tree Collapse file tree 2 files changed +9
-17
lines changed
prettyprinter-ansi-terminal/src/Prettyprinter/Render/Terminal
prettyprinter/src/Prettyprinter/Render Expand file tree Collapse file tree 2 files changed +9
-17
lines changed Original file line number Diff line number Diff line change 11{-# LANGUAGE CPP #-}
2- {-# LANGUAGE LambdaCase #-}
32{-# LANGUAGE OverloadedStrings #-}
43
54{-# OPTIONS_HADDOCK not-home #-}
@@ -63,12 +62,6 @@ modifyIORef' ref f = do
6362 x <- readIORef ref
6463 let x' = f x
6564 x' `seq` writeIORef ref x'
66-
67- modifySTRef' :: STRef s a -> (a -> a ) -> ST s ()
68- modifySTRef' ref f = do
69- x <- readSTRef ref
70- let x' = f x
71- x' `seq` writeSTRef ref x'
7265#endif
7366
7467-- $setup
@@ -150,15 +143,15 @@ underlined = mempty { ansiUnderlining = Just Underlined }
150143renderLazy :: SimpleDocStream AnsiStyle -> TL. Text
151144renderLazy =
152145 let push x = (x : )
153- unsafePeek = \ case
154- [] -> panicPeekedEmpty
155- x: _ -> x
156- unsafePop = \ case
157- [] -> panicPeekedEmpty
158- x: xs -> (x, xs)
146+
147+ unsafePeek [] = panicPeekedEmpty
148+ unsafePeek ( x: _) = x
149+
150+ unsafePop [] = panicPoppedEmpty
151+ unsafePop ( x: xs) = (x, xs)
159152
160153 go :: [AnsiStyle ] -> SimpleDocStream AnsiStyle -> TLB. Builder
161- go s = \ case
154+ go s sds = case sds of
162155 SFail -> panicUncaughtFail
163156 SEmpty -> mempty
164157 SChar c rest -> TLB. singleton c <> go s rest
@@ -205,7 +198,7 @@ renderIO h sdoc = do
205198 [] -> panicPeekedEmpty
206199 x: _ -> pure x
207200 unsafePop = readIORef styleStackRef >>= \ tok -> case tok of
208- [] -> panicPeekedEmpty
201+ [] -> panicPoppedEmpty
209202 x: xs -> writeIORef styleStackRef xs >> pure x
210203
211204 let go = \ sds -> case sds of
Original file line number Diff line number Diff line change 11{-# LANGUAGE CPP #-}
2- {-# LANGUAGE LambdaCase #-}
32{-# LANGUAGE OverloadedStrings #-}
43
54#include "version-compatibility-macros.h"
@@ -58,7 +57,7 @@ import Control.Applicative
5857renderLazy :: SimpleDocStream ann -> TL. Text
5958renderLazy = TLB. toLazyText . go
6059 where
61- go = \ case
60+ go x = case x of
6261 SFail -> panicUncaughtFail
6362 SEmpty -> mempty
6463 SChar c rest -> TLB. singleton c <> go rest
You can’t perform that action at this time.
0 commit comments