Skip to content

Commit 4baf20e

Browse files
committed
style: Fix hlint warnings
1 parent 5bb5cfc commit 4baf20e

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

xml-conduit/src/Text/XML.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ fromEvents = do
272272
d <- D.fromEvents
273273
either (lift . throwM . UnresolvedEntityException) return $ fromXMLDocument d
274274

275-
data UnresolvedEntityException = UnresolvedEntityException (Set Text)
275+
newtype UnresolvedEntityException = UnresolvedEntityException (Set Text)
276276
deriving (Show, Typeable)
277277
instance Exception UnresolvedEntityException
278278

xml-conduit/src/Text/XML/Cursor.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ laxAttribute n c =
195195
case node c of
196196
NodeElement e -> do
197197
(n', v) <- Map.toList $ elementAttributes e
198-
guard $ (on (==) T.toCaseFold) n (nameLocalName n')
198+
guard $ on (==) T.toCaseFold n (nameLocalName n')
199199
return v
200200
_ -> []
201201

xml-conduit/src/Text/XML/Stream/Parse.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,7 @@ newtype AttrParser a = AttrParser { runAttrParser :: [(Name, [Content])] -> Eith
11521152

11531153
instance Monad AttrParser where
11541154
(AttrParser f) >>= g = AttrParser $ \as ->
1155-
either Left (\(as', f') -> runAttrParser (g f') as') (f as)
1155+
(\(as', f') -> runAttrParser (g f') as') =<< (f as)
11561156
instance Functor AttrParser where
11571157
fmap = liftM
11581158
instance Applicative AttrParser where

xml-conduit/src/Text/XML/Stream/Render/Internal.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ content :: (Monad m) => Text -> ConduitT i Event m ()
405405
content = yield . EventContent . ContentText
406406

407407
-- | A list of attributes.
408-
data Attributes = Attributes [(Name, [Content])]
408+
newtype Attributes = Attributes [(Name, [Content])]
409409

410410
instance Monoid Attributes where
411411
mempty = Attributes mempty

xml-conduit/src/Text/XML/Stream/Token.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ tokenToBuilder (TokenBeginElement name attrs' isEmpty indent) =
5252
foldAttrs
5353
(if indent == 0 || lessThan3 attrs
5454
then oneSpace
55-
else mconcat $ ("\n" : replicate indent " "))
55+
else mconcat ("\n" : replicate indent " "))
5656
attrs <>
5757
(if isEmpty then "/>" else ">")
5858
where
@@ -101,10 +101,10 @@ data EscapeContext = ECContent -- ^ <el>..</el>
101101
{-# INLINE charUtf8XmlEscaped #-}
102102
charUtf8XmlEscaped :: EscapeContext -> E.BoundedPrim Word8
103103
charUtf8XmlEscaped ec =
104-
(condB (> _gt) (E.liftFixedToBounded E.word8)) $
105-
(condB (== _lt) (fixed4 (_am,(_l,(_t,_sc))))) $ -- &lt;
104+
condB (> _gt) (E.liftFixedToBounded E.word8) $
105+
condB (== _lt) (fixed4 (_am,(_l,(_t,_sc)))) $ -- &lt;
106106
escapeFor ECContent (condB (== _gt) (fixed4 (_am,(_g,(_t,_sc))))) $ -- &gt;
107-
(condB (== _am) (fixed5 (_am,(_a,(_m,(_p,_sc)))))) $ -- &amp;
107+
condB (== _am) (fixed5 (_am,(_a,(_m,(_p,_sc))))) $ -- &amp;
108108
escapeFor ECDoubleArg (condB (== _dq) (fixed6 (_am,(_q,(_u,(_o,(_t,_sc))))))) $ -- &quot;
109109
escapeFor ECSingleArg (condB (== _sq) (fixed6 (_am,(_a,(_p,(_o,(_s,_sc))))))) $ -- &apos;
110110
(E.liftFixedToBounded E.word8) -- fallback for Chars smaller than '>'

xml-conduit/src/Text/XML/Unresolved.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ elementFromEvents = goE
219219
goN = do
220220
x <- CL.peek
221221
case x of
222-
Just (_, EventBeginElement n as) -> (Just . NodeElement) <$> goE' n as
222+
Just (_, EventBeginElement n as) -> Just . NodeElement <$> goE' n as
223223
Just (_, EventInstruction i) -> dropReturn $ Just $ NodeInstruction i
224224
Just (_, EventContent c) -> dropReturn $ Just $ NodeContent c
225225
Just (_, EventComment t) -> dropReturn $ Just $ NodeComment t

0 commit comments

Comments
 (0)