mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 08:49:40 +03:00
eta reductions
This commit is contained in:
parent
90ea18379d
commit
ec463f1c85
@ -64,7 +64,7 @@ writeCapExpr cap params =
|
||||
in snd $ runWriter (runStateT (writeCapOps (capOps cap)) s0)
|
||||
|
||||
writeCapOps :: CapOps -> Eval ()
|
||||
writeCapOps ops = mapM_ writeCapOp ops
|
||||
writeCapOps = mapM_ writeCapOp
|
||||
|
||||
writeCapOp :: CapOp -> Eval ()
|
||||
writeCapOp (Bytes !offset !count) = do
|
||||
|
@ -146,7 +146,7 @@ data Image =
|
||||
|
||||
-- | pretty print just the structure of an image.
|
||||
ppImageStructure :: Image -> String
|
||||
ppImageStructure inImg = go 0 inImg
|
||||
ppImageStructure = go 0
|
||||
where
|
||||
go indent img = tab indent ++ pp indent img
|
||||
tab indent = concat $ replicate indent " "
|
||||
|
@ -136,8 +136,8 @@ mergeUnder upper lower = do
|
||||
return upper
|
||||
|
||||
mergeRowUnder :: SpanOps -> SpanOps -> SpanOps
|
||||
mergeRowUnder upperRowOps lowerRowOps =
|
||||
onUpperOp Vector.empty (Vector.head upperRowOps) (Vector.tail upperRowOps) lowerRowOps
|
||||
mergeRowUnder upperRowOps =
|
||||
onUpperOp Vector.empty (Vector.head upperRowOps) (Vector.tail upperRowOps)
|
||||
where
|
||||
-- H: it will never be the case that we are out of upper ops
|
||||
-- before lower ops.
|
||||
|
@ -52,7 +52,7 @@ dropOps :: Int -> SpanOps -> SpanOps
|
||||
dropOps w = snd . splitOpsAt w
|
||||
|
||||
splitOpsAt :: Int -> SpanOps -> (SpanOps, SpanOps)
|
||||
splitOpsAt inW inOps = splitOpsAt' inW inOps
|
||||
splitOpsAt = splitOpsAt'
|
||||
where
|
||||
splitOpsAt' 0 ops = (Vector.empty, ops)
|
||||
splitOpsAt' remainingColumns ops = case Vector.head ops of
|
||||
@ -103,7 +103,7 @@ displayOpsColumns ops
|
||||
|
||||
-- | The number of rows the DisplayOps are defined for.
|
||||
displayOpsRows :: DisplayOps -> Int
|
||||
displayOpsRows ops = Vector.length ops
|
||||
displayOpsRows = Vector.length
|
||||
|
||||
affectedRegion :: DisplayOps -> DisplayRegion
|
||||
affectedRegion ops = (displayOpsColumns ops, displayOpsRows ops)
|
||||
|
Loading…
Reference in New Issue
Block a user