mirror of
https://github.com/composewell/streamly.git
synced 2024-09-11 19:47:10 +03:00
fix hlint warnings
and remove fixed files from .hlint.ignore
This commit is contained in:
parent
c9eff7e271
commit
df553b1d5b
@ -17,7 +17,6 @@ src/Streamly/Internal/Data/Stream/StreamD.hs
|
||||
src/Streamly/Internal/Data/SmallArray.hs
|
||||
src/Streamly/Internal/Data/Pipe/Types.hs
|
||||
src/Streamly/Internal/Data/Pipe.hs
|
||||
src/Streamly/Internal/Data/Array.hs
|
||||
src/Streamly/Internal/Data/Sink/Types.hs
|
||||
src/Streamly/Internal/Data/Sink.hs
|
||||
src/Streamly/Internal/Data/Zipper/Array.hs
|
||||
@ -26,13 +25,10 @@ src/Streamly/Internal/Data/Parser/ParserD.hs
|
||||
src/Streamly/Internal/Data/Time/Units.hs
|
||||
src/Streamly/Internal/Data/Prim/Array.hs
|
||||
src/Streamly/Internal/Data/Prim/Array/Types.hs
|
||||
src/Streamly/Internal/Data/Fold/Types.hs
|
||||
src/Streamly/Internal/Data/Fold.hs
|
||||
src/Streamly/Internal/Data/SmallArray/Types.hs
|
||||
src/Streamly/Internal/Data/Unfold.hs
|
||||
src/Streamly/Internal/Data/Unicode/Stream.hs
|
||||
src/Streamly/Internal/Memory/Array/Types.hs
|
||||
src/Streamly/Internal/Prelude.hs
|
||||
src/Streamly/Internal/Mutable/Prim/Var.hs
|
||||
src/Streamly/Internal/Network/Socket.hs
|
||||
src/Streamly/Internal/Data/Stream/Prelude.hs
|
||||
|
@ -215,10 +215,10 @@ import Data.Int (Int64)
|
||||
import Data.Map.Strict (Map)
|
||||
|
||||
import Prelude
|
||||
hiding (filter, drop, dropWhile, take, takeWhile, zipWith, foldr,
|
||||
hiding (filter, drop, dropWhile, take, takeWhile, zipWith,
|
||||
foldl, map, mapM_, sequence, all, any, sum, product, elem,
|
||||
notElem, maximum, minimum, head, last, tail, length, null,
|
||||
reverse, iterate, init, and, or, lookup, foldr1, (!!),
|
||||
reverse, iterate, init, and, or, lookup, (!!),
|
||||
scanl, scanl1, replicate, concatMap, mconcat, foldMap, unzip,
|
||||
span, splitAt, break, mapM)
|
||||
|
||||
@ -332,7 +332,7 @@ transform (Pipe pstep1 pstep2 pinitial) (Fold fstep finitial fextract) =
|
||||
|
||||
where
|
||||
|
||||
initial = Tuple' <$> return pinitial <*> finitial
|
||||
initial = Tuple' pinitial <$> finitial
|
||||
step (Tuple' ps fs) x = do
|
||||
r <- pstep1 ps x
|
||||
go fs r
|
||||
@ -929,7 +929,7 @@ splitAt
|
||||
splitAt n (Fold stepL initialL extractL) (Fold stepR initialR extractR) =
|
||||
Fold step initial extract
|
||||
where
|
||||
initial = Tuple3' <$> return n <*> initialL <*> initialR
|
||||
initial = Tuple3' n <$> initialL <*> initialR
|
||||
|
||||
step (Tuple3' i xL xR) input =
|
||||
if i > 0
|
||||
@ -1158,8 +1158,7 @@ foldCons (Fold stepL beginL doneL) (Fold stepR beginR doneR) =
|
||||
-- @since 0.7.0
|
||||
{-# INLINE distribute #-}
|
||||
distribute :: Monad m => [Fold m a b] -> Fold m a [b]
|
||||
distribute [] = foldNil
|
||||
distribute (x:xs) = foldCons x (distribute xs)
|
||||
distribute = foldr foldCons foldNil
|
||||
|
||||
-- | Like 'distribute' but for folds that return (), this can be more efficient
|
||||
-- than 'distribute' as it does not need to maintain state.
|
||||
@ -1173,9 +1172,8 @@ distribute_ fs = Fold step initial extract
|
||||
step ss a = do
|
||||
Prelude.mapM_ (\(Fold s i _) -> i >>= \r -> void (s r a)) ss
|
||||
return ss
|
||||
extract ss = do
|
||||
extract ss =
|
||||
Prelude.mapM_ (\(Fold _ i e) -> i >>= \r -> e r) ss
|
||||
return ()
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Partitioning
|
||||
@ -1235,7 +1233,7 @@ partitionByM f (Fold stepL beginL doneL) (Fold stepR beginR doneR) =
|
||||
r <- f a
|
||||
case r of
|
||||
Left b -> Tuple' <$> stepL xL b <*> return xR
|
||||
Right c -> Tuple' <$> return xL <*> stepR xR c
|
||||
Right c -> Tuple' xL <$> stepR xR c
|
||||
done (Tuple' xL xR) = (,) <$> doneL xL <*> doneR xR
|
||||
|
||||
-- Note: we could use (a -> Bool) instead of (a -> Either b c), but the latter
|
||||
@ -1369,8 +1367,8 @@ demuxWithDefault_ f kv (Fold dstep dinitial dextract) =
|
||||
initFold (Fold s i e) = i >>= \r -> return (Fold s (return r) e)
|
||||
initial = do
|
||||
mp <- Prelude.mapM initFold kv
|
||||
dacc <- dinitial
|
||||
return (Tuple' mp dacc)
|
||||
Tuple' mp <$> dinitial
|
||||
|
||||
step (Tuple' mp dacc) a
|
||||
| (k, a') <- f a
|
||||
= case Map.lookup k mp of
|
||||
|
@ -252,7 +252,7 @@ connectionsOnLocalHost = connectionsOnAddr (127,0,0,1)
|
||||
connect :: (Word8, Word8, Word8, Word8) -> PortNumber -> IO Socket
|
||||
connect addr port = do
|
||||
sock <- socket AF_INET Stream defaultProtocol
|
||||
(Net.connect sock $ SockAddrInet port (Net.tupleToHostAddress addr))
|
||||
Net.connect sock (SockAddrInet port (Net.tupleToHostAddress addr))
|
||||
`onException` Net.close sock
|
||||
return sock
|
||||
|
||||
|
@ -3207,7 +3207,7 @@ parseIterate
|
||||
-> t m a
|
||||
-> t m b
|
||||
parseIterate f i m = D.fromStreamD $
|
||||
D.parseIterate (\b -> PRD.fromParserK $ f b) i (D.toStreamD m)
|
||||
D.parseIterate (PRD.fromParserK . f) i (D.toStreamD m)
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
-- Grouping/Splitting
|
||||
|
Loading…
Reference in New Issue
Block a user