on master help sign in
revert pattern brackets
9c47955Willem Van Onsem
src/Graphics/Vty/Image.hs+4−4
@@ -297,7 +297,7 @@ cropBottom h inI
297 | otherwise = go inI
297 | otherwise = go inI
298 where
298 where
299 go EmptyImage = EmptyImage
299 go EmptyImage = EmptyImage
300− go i@CropBottom {croppedImage, outputWidth, outputHeight}
300+ go i@(CropBottom {croppedImage, outputWidth, outputHeight})
301 | outputHeight <= h = i
301 | outputHeight <= h = i
302 | otherwise = CropBottom croppedImage outputWidth h
302 | otherwise = CropBottom croppedImage outputWidth h
303 go i
303 go i
@@ -314,7 +314,7 @@ cropRight w inI
314 | otherwise = go inI
314 | otherwise = go inI
315 where
315 where
316 go EmptyImage = EmptyImage
316 go EmptyImage = EmptyImage
317− go i@CropRight {croppedImage, outputWidth, outputHeight}
317+ go i@(CropRight {croppedImage, outputWidth, outputHeight})
318 | outputWidth <= w = i
318 | outputWidth <= w = i
319 | otherwise = CropRight croppedImage w outputHeight
319 | otherwise = CropRight croppedImage w outputHeight
320 go i
320 go i
@@ -331,7 +331,7 @@ cropLeft w inI
331 | otherwise = go inI
331 | otherwise = go inI
332 where
332 where
333 go EmptyImage = EmptyImage
333 go EmptyImage = EmptyImage
334− go i@CropLeft {croppedImage, leftSkip, outputWidth, outputHeight}
334+ go i@(CropLeft {croppedImage, leftSkip, outputWidth, outputHeight})
335 | outputWidth <= w = i
335 | outputWidth <= w = i
336 | otherwise =
336 | otherwise =
337 let leftSkip' = leftSkip + outputWidth - w
337 let leftSkip' = leftSkip + outputWidth - w
@@ -350,7 +350,7 @@ cropTop h inI
350 | otherwise = go inI
350 | otherwise = go inI
351 where
351 where
352 go EmptyImage = EmptyImage
352 go EmptyImage = EmptyImage
353− go i@CropTop {croppedImage, topSkip, outputWidth, outputHeight}
353+ go i@(CropTop {croppedImage, topSkip, outputWidth, outputHeight})
354 | outputHeight <= h = i
354 | outputHeight <= h = i
355 | otherwise =
355 | otherwise =
356 let topSkip' = topSkip + outputHeight - h
356 let topSkip' = topSkip + outputHeight - h
src/Graphics/Vty/Image/Internal.hs+8−8
@@ -150,25 +150,25 @@ ppImageStructure inImg = go 0 inImg
150 where
150 where
151 go indent img = tab indent ++ pp indent img
151 go indent img = tab indent ++ pp indent img
152 tab indent = concat $ replicate indent " "
152 tab indent = concat $ replicate indent " "
153− pp _ HorizText {outputWidth} = "HorizText(" ++ show outputWidth ++ ")"
153+ pp _ (HorizText {outputWidth}) = "HorizText(" ++ show outputWidth ++ ")"
154− pp _ BGFill {outputWidth, outputHeight}
154+ pp _ (BGFill {outputWidth, outputHeight})
155 = "BGFill(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")"
155 = "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})
157 = "HorizJoin(" ++ show c ++ ")\n" ++ go (i+1) l ++ "\n" ++ go (i+1) r
157 = "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})
159 = "VertJoin(" ++ show c ++ ", " ++ show r ++ ")\n"
159 = "VertJoin(" ++ show c ++ ", " ++ show r ++ ")\n"
160 ++ go (i+1) t ++ "\n"
160 ++ go (i+1) t ++ "\n"
161 ++ go (i+1) b
161 ++ go (i+1) b
162− pp i CropRight {croppedImage, outputWidth, outputHeight}
162+ pp i (CropRight {croppedImage, outputWidth, outputHeight})
163 = "CropRight(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
163 = "CropRight(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
164 ++ go (i+1) croppedImage
164 ++ go (i+1) croppedImage
165− pp i CropLeft {croppedImage, leftSkip, outputWidth, outputHeight}
165+ pp i (CropLeft {croppedImage, leftSkip, outputWidth, outputHeight})
166 = "CropLeft(" ++ show leftSkip ++ "->" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
166 = "CropLeft(" ++ show leftSkip ++ "->" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
167 ++ go (i+1) croppedImage
167 ++ go (i+1) croppedImage
168− pp i CropBottom {croppedImage, outputWidth, outputHeight}
168+ pp i (CropBottom {croppedImage, outputWidth, outputHeight})
169 = "CropBottom(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
169 = "CropBottom(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
170 ++ go (i+1) croppedImage
170 ++ go (i+1) croppedImage
171− pp i CropTop {croppedImage, topSkip, outputWidth, outputHeight}
171+ pp i (CropTop {croppedImage, topSkip, outputWidth, outputHeight})
172 = "CropTop("++ show outputWidth ++ "," ++ show topSkip ++ "->" ++ show outputHeight ++ ")\n"
172 = "CropTop("++ show outputWidth ++ "," ++ show topSkip ++ "->" ++ show outputHeight ++ ")\n"
173 ++ go (i+1) croppedImage
173 ++ go (i+1) croppedImage
174 pp _ EmptyImage = "EmptyImage"
174 pp _ EmptyImage = "EmptyImage"
src/Graphics/Vty/Input/Loop.hs+1−1
@@ -143,7 +143,7 @@ readFromDevice = do
143 return stringRep
143 return stringRep
144
144
145applyConfig :: Fd -> Config -> IO ()
145applyConfig :: Fd -> Config -> IO ()
146−applyConfig fd Config{ vmin = Just theVmin, vtime = Just theVtime }
146+applyConfig fd (Config{ vmin = Just theVmin, vtime = Just theVtime })
147 = setTermTiming fd theVmin (theVtime `div` 100)
147 = setTermTiming fd theVmin (theVtime `div` 100)
148applyConfig _ _ = fail "(vty) applyConfig was not provided a complete configuration"
148applyConfig _ _ = fail "(vty) applyConfig was not provided a complete configuration"
149
149
src/Graphics/Vty/PictureToSpans.hs+1−1
@@ -109,7 +109,7 @@ substituteSkips ClearBackground ops = do
109 let rowOps'' = swapSkipsForSingleColumnCharSpan ' ' currentAttr rowOps'
109 let rowOps'' = swapSkipsForSingleColumnCharSpan ' ' currentAttr rowOps'
110 MVector.write ops row rowOps''
110 MVector.write ops row rowOps''
111 return ops
111 return ops
112−substituteSkips Background {backgroundChar, backgroundAttr} ops = do
112+substituteSkips (Background {backgroundChar, backgroundAttr}) ops = do
113 -- At this point we decide if the background character is single
113 -- At this point we decide if the background character is single
114 -- column or not. obviously, single column is easier.
114 -- column or not. obviously, single column is easier.
115 case safeWcwidth backgroundChar of
115 case safeWcwidth backgroundChar of
src/Graphics/Vty/Span.hs+1−1
@@ -56,7 +56,7 @@ splitOpsAt inW inOps = splitOpsAt' inW inOps
56 where
56 where
57 splitOpsAt' 0 ops = (Vector.empty, ops)
57 splitOpsAt' 0 ops = (Vector.empty, ops)
58 splitOpsAt' remainingColumns ops = case Vector.head ops of
58 splitOpsAt' remainingColumns ops = case Vector.head ops of
59− t@TextSpan {} -> if remainingColumns >= textSpanOutputWidth t
59+ t@(TextSpan {}) -> if remainingColumns >= textSpanOutputWidth t
60 then let (pre,post) = splitOpsAt' (remainingColumns - textSpanOutputWidth t)
60 then let (pre,post) = splitOpsAt' (remainingColumns - textSpanOutputWidth t)
61 (Vector.tail ops)
61 (Vector.tail ops)
62 in (Vector.cons t pre, post)
62 in (Vector.cons t pre, post)