remove useless parenthesis and ellipse

This commit is contained in:
Willem Van Onsem 2021-02-15 23:07:09 +01:00
parent 90ea18379d
commit 0e5c1646f6
7 changed files with 20 additions and 20 deletions

View File

@ -336,9 +336,9 @@ data BuildResults = BuildResults
instance Semigroup BuildResults where
v0 <> v1
= BuildResults
{ outParamCount = (outParamCount v0) `max` (outParamCount v1)
, outCapOps = (outCapOps v0) <> (outCapOps v1)
, outParamOps = (outParamOps v0) <> (outParamOps v1)
{ outParamCount = outParamCount v0 `max` outParamCount v1
, outCapOps = outCapOps v0 <> outCapOps v1
, outParamOps = outParamOps v0 <> outParamOps v1
}
instance Monoid BuildResults where

View File

@ -297,7 +297,7 @@ cropBottom h inI
| otherwise = go inI
where
go EmptyImage = EmptyImage
go i@(CropBottom {croppedImage, outputWidth, outputHeight})
go i@CropBottom {croppedImage, outputWidth, outputHeight}
| outputHeight <= h = i
| otherwise = CropBottom croppedImage outputWidth h
go i
@ -314,7 +314,7 @@ cropRight w inI
| otherwise = go inI
where
go EmptyImage = EmptyImage
go i@(CropRight {croppedImage, outputWidth, outputHeight})
go i@CropRight {croppedImage, outputWidth, outputHeight}
| outputWidth <= w = i
| otherwise = CropRight croppedImage w outputHeight
go i
@ -331,7 +331,7 @@ cropLeft w inI
| otherwise = go inI
where
go EmptyImage = EmptyImage
go i@(CropLeft {croppedImage, leftSkip, outputWidth, outputHeight})
go i@CropLeft {croppedImage, leftSkip, outputWidth, outputHeight}
| outputWidth <= w = i
| otherwise =
let leftSkip' = leftSkip + outputWidth - w
@ -350,7 +350,7 @@ cropTop h inI
| otherwise = go inI
where
go EmptyImage = EmptyImage
go i@(CropTop {croppedImage, topSkip, outputWidth, outputHeight})
go i@CropTop {croppedImage, topSkip, outputWidth, outputHeight}
| outputHeight <= h = i
| otherwise =
let topSkip' = topSkip + outputHeight - h

View File

@ -150,25 +150,25 @@ ppImageStructure inImg = go 0 inImg
where
go indent img = tab indent ++ pp indent img
tab indent = concat $ replicate indent " "
pp _ (HorizText {outputWidth}) = "HorizText(" ++ show outputWidth ++ ")"
pp _ (BGFill {outputWidth, outputHeight})
pp _ HorizText {outputWidth} = "HorizText(" ++ show outputWidth ++ ")"
pp _ BGFill {outputWidth, outputHeight}
= "BGFill(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")"
pp i (HorizJoin {partLeft = l, partRight = r, outputWidth = c})
pp i HorizJoin {partLeft = l, partRight = r, outputWidth = c}
= "HorizJoin(" ++ show c ++ ")\n" ++ go (i+1) l ++ "\n" ++ go (i+1) r
pp i (VertJoin {partTop = t, partBottom = b, outputWidth = c, outputHeight = r})
pp i VertJoin {partTop = t, partBottom = b, outputWidth = c, outputHeight = r}
= "VertJoin(" ++ show c ++ ", " ++ show r ++ ")\n"
++ go (i+1) t ++ "\n"
++ go (i+1) b
pp i (CropRight {croppedImage, outputWidth, outputHeight})
pp i CropRight {croppedImage, outputWidth, outputHeight}
= "CropRight(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
++ go (i+1) croppedImage
pp i (CropLeft {croppedImage, leftSkip, outputWidth, outputHeight})
pp i CropLeft {croppedImage, leftSkip, outputWidth, outputHeight}
= "CropLeft(" ++ show leftSkip ++ "->" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
++ go (i+1) croppedImage
pp i (CropBottom {croppedImage, outputWidth, outputHeight})
pp i CropBottom {croppedImage, outputWidth, outputHeight}
= "CropBottom(" ++ show outputWidth ++ "," ++ show outputHeight ++ ")\n"
++ go (i+1) croppedImage
pp i (CropTop {croppedImage, topSkip, outputWidth, outputHeight})
pp i CropTop {croppedImage, topSkip, outputWidth, outputHeight}
= "CropTop("++ show outputWidth ++ "," ++ show topSkip ++ "->" ++ show outputHeight ++ ")\n"
++ go (i+1) croppedImage
pp _ EmptyImage = "EmptyImage"

View File

@ -143,7 +143,7 @@ readFromDevice = do
return stringRep
applyConfig :: Fd -> Config -> IO ()
applyConfig fd (Config{ vmin = Just theVmin, vtime = Just theVtime })
applyConfig fd Config{ vmin = Just theVmin, vtime = Just theVtime }
= setTermTiming fd theVmin (theVtime `div` 100)
applyConfig _ _ = fail "(vty) applyConfig was not provided a complete configuration"
@ -224,7 +224,7 @@ logInitialInputState input classifyTable = case _inputDebug input of
Just h -> do
Config{ vmin = Just theVmin
, vtime = Just theVtime
, termName = Just theTerm, .. } <- readIORef $ _configRef input
, termName = Just theTerm } <- readIORef $ _configRef input
_ <- hPrintf h "initial (vmin,vtime): %s\n" (show (theVmin, theVtime))
forM_ classifyTable $ \i -> case i of
(inBytes, EvKey k mods) -> hPrintf h "map %s %s %s %s\n" (show theTerm)

View File

@ -74,7 +74,7 @@ visibleChars = [ ([x], EvKey (KChar x) [])
ctrlChars :: ClassifyMap
ctrlChars =
[ ([toEnum x],EvKey (KChar y) [MCtrl])
| (x,y) <- zip ([0..31]) ('@':['a'..'z']++['['..'_'])
| (x,y) <- zip [0..31] ('@':['a'..'z']++['['..'_'])
, y /= 'i' -- Resolve issue #3 where CTRL-i hides TAB.
, y /= 'h' -- CTRL-h should not hide BS
]

View File

@ -109,7 +109,7 @@ substituteSkips ClearBackground ops = do
let rowOps'' = swapSkipsForSingleColumnCharSpan ' ' currentAttr rowOps'
MVector.write ops row rowOps''
return ops
substituteSkips (Background {backgroundChar, backgroundAttr}) ops = do
substituteSkips Background {backgroundChar, backgroundAttr} ops = do
-- At this point we decide if the background character is single
-- column or not. obviously, single column is easier.
case safeWcwidth backgroundChar of

View File

@ -56,7 +56,7 @@ splitOpsAt inW inOps = splitOpsAt' inW inOps
where
splitOpsAt' 0 ops = (Vector.empty, ops)
splitOpsAt' remainingColumns ops = case Vector.head ops of
t@(TextSpan {}) -> if remainingColumns >= textSpanOutputWidth t
t@TextSpan {} -> if remainingColumns >= textSpanOutputWidth t
then let (pre,post) = splitOpsAt' (remainingColumns - textSpanOutputWidth t)
(Vector.tail ops)
in (Vector.cons t pre, post)