mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-29 08:49:40 +03:00
avoid lambda expressions
This commit is contained in:
parent
90ea18379d
commit
b5da64bb63
@ -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)
|
||||||
|
@ -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)
|
||||||
|
@ -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)
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user