avoid lambda expressions

This commit is contained in:
Willem Van Onsem 2021-02-15 17:39:53 +01:00
parent 90ea18379d
commit b5da64bb63
4 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ import Data.Sequence
import Control.Parallel.Strategies import Control.Parallel.Strategies
instance NFData a => NFData (Seq a) where instance NFData a => NFData (Seq a) where
rnf = \v -> rnf' (viewl v) rnf = rnf' . viewl
where where
rnf' EmptyL = () rnf' EmptyL = ()
rnf' (a :< r) = rnf a >| rnf' (viewl r) rnf' (a :< r) = rnf a >| rnf' (viewl r)

View File

@ -39,7 +39,7 @@ instance Show CapExpression where
++ " <= " ++ show (sourceString c) ++ " <= " ++ show (sourceString c)
where where
hexDump :: [Word8] -> String hexDump :: [Word8] -> String
hexDump = foldr (\b s -> showHex b s) "" hexDump = foldr showHex ""
instance NFData CapExpression where instance NFData CapExpression where
rnf (CapExpression ops !_bytes !str !c !pOps) rnf (CapExpression ops !_bytes !str !c !pOps)

View File

@ -203,7 +203,7 @@ reserveTerminal termName outFd = do
, assumedStateRef = newAssumedStateRef , assumedStateRef = newAssumedStateRef
-- I think fix would help assure tActual is the only -- I think fix would help assure tActual is the only
-- reference. I was having issues tho. -- reference. I was having issues tho.
, mkDisplayContext = \tActual -> terminfoDisplayContext tActual terminfoCaps , mkDisplayContext = (`terminfoDisplayContext` terminfoCaps)
} }
sendCap s = sendCapToTerminal t (s terminfoCaps) sendCap s = sendCapToTerminal t (s terminfoCaps)
maybeSendCap s = when (isJust $ s terminfoCaps) . sendCap (fromJust . s) maybeSendCap s = when (isJust $ s terminfoCaps) . sendCap (fromJust . s)

View File

@ -81,7 +81,7 @@ combinedOpsForLayers :: Picture -> DisplayRegion -> ST s (MRowOps s)
combinedOpsForLayers pic r combinedOpsForLayers pic r
| regionWidth r == 0 || regionHeight r == 0 = MVector.new 0 | regionWidth r == 0 || regionHeight r == 0 = MVector.new 0
| otherwise = do | otherwise = do
layerOps <- mapM (\layer -> buildSpans layer r) (picLayers pic) layerOps <- mapM (`buildSpans` layer) (picLayers pic)
case layerOps of case layerOps of
[] -> fail "empty picture" [] -> fail "empty picture"
[ops] -> substituteSkips (picBackground pic) ops [ops] -> substituteSkips (picBackground pic) ops