on master help sign in
revert pattern brackets
commit9c479554eea9a919a44687ab868f83ff9e8412fb authorWillem Van Onsem <vanonsem.willem@gmail.com> dateMon 15 Feb 2021, 23:59 (6 years ago) parent0e5c164
5 files changed+15−15
src/Graphics/Vty/Image.hs+4−4 src/Graphics/Vty/Image/Internal.hs+8−8 src/Graphics/Vty/Input/Loop.hs+1−1 src/Graphics/Vty/PictureToSpans.hs+1−1 src/Graphics/Vty/Span.hs+1−1
src/Graphics/Vty/Image.hs+4−4
@@ -297,7 +297,7 @@ cropBottom h inI
297297 | otherwise = go inI
298298 where
299299 go EmptyImage = EmptyImage
300− go i@CropBottom {croppedImage, outputWidth, outputHeight}
300+ go i@(CropBottom {croppedImage, outputWidth, outputHeight})
301301 | outputHeight <= h = i
302302 | otherwise = CropBottom croppedImage outputWidth h
303303 go i
@@ -314,7 +314,7 @@ cropRight w inI
314314 | otherwise = go inI
315315 where
316316 go EmptyImage = EmptyImage
317− go i@CropRight {croppedImage, outputWidth, outputHeight}
317+ go i@(CropRight {croppedImage, outputWidth, outputHeight})
318318 | outputWidth <= w = i
319319 | otherwise = CropRight croppedImage w outputHeight
320320 go i
@@ -331,7 +331,7 @@ cropLeft w inI
331331 | otherwise = go inI
332332 where
333333 go EmptyImage = EmptyImage
334− go i@CropLeft {croppedImage, leftSkip, outputWidth, outputHeight}
334+ go i@(CropLeft {croppedImage, leftSkip, outputWidth, outputHeight})
335335 | outputWidth <= w = i
336336 | otherwise =
337337 let leftSkip' = leftSkip + outputWidth - w
@@ -350,7 +350,7 @@ cropTop h inI
350350 | otherwise = go inI
351351 where
352352 go EmptyImage = EmptyImage
353− go i@CropTop {croppedImage, topSkip, outputWidth, outputHeight}
353+ go i@(CropTop {croppedImage, topSkip, outputWidth, outputHeight})
354354 | outputHeight <= h = i
355355 | otherwise =
356356 let topSkip' = topSkip + outputHeight - h
src/Graphics/Vty/Image/Internal.hs+8−8
@@ -150,25 +150,25 @@ ppImageStructure inImg = go 0 inImg
150150 where
151151 go indent img = tab indent ++ pp indent img
152152 tab indent = concat $ replicate indent " "
153− pp _ HorizText {outputWidth} = "HorizText(" ++ show outputWidth ++ ")"
154− pp _ BGFill {outputWidth, outputHeight}
153+ pp _ (HorizText {outputWidth}) = "HorizText(" ++ show outputWidth ++ ")"
154+ pp _ (BGFill {outputWidth, outputHeight})
155155 = "BGFill(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")"
156− pp i HorizJoin {partLeft = l, partRight = r, outputWidth = c}
156+ pp i (HorizJoin {partLeft = l, partRight = r, outputWidth = c})
157157 = "HorizJoin(" ++ show c ++ ")\n" ++ go (i+1) l ++ "\n" ++ go (i+1) r
158− pp i VertJoin {partTop = t, partBottom = b, outputWidth = c, outputHeight = r}
158+ pp i (VertJoin {partTop = t, partBottom = b, outputWidth = c, outputHeight = r})
159159 = "VertJoin(" ++ show c ++ ", " ++ show r ++ ")\n"
160160 ++ go (i+1) t ++ "\n"
161161 ++ go (i+1) b
162− pp i CropRight {croppedImage, outputWidth, outputHeight}
162+ pp i (CropRight {croppedImage, outputWidth, outputHeight})
163163 = "CropRight(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
164164 ++ go (i+1) croppedImage
165− pp i CropLeft {croppedImage, leftSkip, outputWidth, outputHeight}
165+ pp i (CropLeft {croppedImage, leftSkip, outputWidth, outputHeight})
166166 = "CropLeft(" ++ show leftSkip ++ "->" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
167167 ++ go (i+1) croppedImage
168− pp i CropBottom {croppedImage, outputWidth, outputHeight}
168+ pp i (CropBottom {croppedImage, outputWidth, outputHeight})
169169 = "CropBottom(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
170170 ++ go (i+1) croppedImage
171− pp i CropTop {croppedImage, topSkip, outputWidth, outputHeight}
171+ pp i (CropTop {croppedImage, topSkip, outputWidth, outputHeight})
172172 = "CropTop("++ show outputWidth ++ "," ++ show topSkip ++ "->" ++ show outputHeight ++ ")\n"
173173 ++ go (i+1) croppedImage
174174 pp _ EmptyImage = "EmptyImage"
src/Graphics/Vty/Input/Loop.hs+1−1
@@ -143,7 +143,7 @@ readFromDevice = do
143143 return stringRep
144144
145145applyConfig :: Fd -> Config -> IO ()
146−applyConfig fd Config{ vmin = Just theVmin, vtime = Just theVtime }
146+applyConfig fd (Config{ vmin = Just theVmin, vtime = Just theVtime })
147147 = setTermTiming fd theVmin (theVtime `div` 100)
148148applyConfig _ _ = fail "(vty) applyConfig was not provided a complete configuration"
149149
src/Graphics/Vty/PictureToSpans.hs+1−1
@@ -109,7 +109,7 @@ substituteSkips ClearBackground ops = do
109109 let rowOps'' = swapSkipsForSingleColumnCharSpan ' ' currentAttr rowOps'
110110 MVector.write ops row rowOps''
111111 return ops
112−substituteSkips Background {backgroundChar, backgroundAttr} ops = do
112+substituteSkips (Background {backgroundChar, backgroundAttr}) ops = do
113113 -- At this point we decide if the background character is single
114114 -- column or not. obviously, single column is easier.
115115 case safeWcwidth backgroundChar of
src/Graphics/Vty/Span.hs+1−1
@@ -56,7 +56,7 @@ splitOpsAt inW inOps = splitOpsAt' inW inOps
5656 where
5757 splitOpsAt' 0 ops = (Vector.empty, ops)
5858 splitOpsAt' remainingColumns ops = case Vector.head ops of
59− t@TextSpan {} -> if remainingColumns >= textSpanOutputWidth t
59+ t@(TextSpan {}) -> if remainingColumns >= textSpanOutputWidth t
6060 then let (pre,post) = splitOpsAt' (remainingColumns - textSpanOutputWidth t)
6161 (Vector.tail ops)
6262 in (Vector.cons t pre, post)