From ec463f1c8569efdb6ee3858712a6a8d6877521a4 Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Mon, 15 Feb 2021 12:12:20 +0100 Subject: [PATCH] eta reductions --- src/Data/Terminfo/Eval.hs | 2 +- src/Graphics/Vty/Image/Internal.hs | 2 +- src/Graphics/Vty/PictureToSpans.hs | 4 ++-- src/Graphics/Vty/Span.hs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Data/Terminfo/Eval.hs b/src/Data/Terminfo/Eval.hs index 9cbf095..bdab55a 100644 --- a/src/Data/Terminfo/Eval.hs +++ b/src/Data/Terminfo/Eval.hs @@ -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 diff --git a/src/Graphics/Vty/Image/Internal.hs b/src/Graphics/Vty/Image/Internal.hs index b1a4cbb..32a9c06 100644 --- a/src/Graphics/Vty/Image/Internal.hs +++ b/src/Graphics/Vty/Image/Internal.hs @@ -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 " " diff --git a/src/Graphics/Vty/PictureToSpans.hs b/src/Graphics/Vty/PictureToSpans.hs index 17a6f87..20df29f 100644 --- a/src/Graphics/Vty/PictureToSpans.hs +++ b/src/Graphics/Vty/PictureToSpans.hs @@ -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. diff --git a/src/Graphics/Vty/Span.hs b/src/Graphics/Vty/Span.hs index 64b480f..76f72ae 100644 --- a/src/Graphics/Vty/Span.hs +++ b/src/Graphics/Vty/Span.hs @@ -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)