Skip to content

Commit e10bd7f

Browse files
committed
Fix compiler warnings: unused-do-binds
Progress #302
1 parent 3490ab2 commit e10bd7f

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

markdown/Cheapskate/Inlines.hs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import qualified Data.Set as Set
2222
-- Returns tag type and whole tag.
2323
pHtmlTag :: Parser (HtmlTagType, Text)
2424
pHtmlTag = do
25-
char '<'
25+
_ <- char '<'
2626
-- do not end the tag with a > character in a quoted attribute.
2727
closing <- (char '/' >> return True) <|> return False
2828
tagname <- takeWhile1 (\c -> isAsciiAlphaNum c || c == '?' || c == '!')
@@ -36,7 +36,7 @@ pHtmlTag = do
3636
return $ ss <> T.singleton x <> xs <> "=" <> v
3737
attrs <- T.concat <$> many attr
3838
final <- takeWhile (\c -> isSpace c || c == '/')
39-
char '>'
39+
_ <- char '>'
4040
let tagtype = if closing
4141
then Closing tagname'
4242
else case T.stripSuffix "/" final of
@@ -57,7 +57,7 @@ pQuoted c = do
5757
-- do for now.
5858
pHtmlComment :: Parser Text
5959
pHtmlComment = do
60-
string "<!--"
60+
_ <- string "<!--"
6161
rest <- manyTill anyChar (string "-->")
6262
return $ "<!--" <> T.pack rest <> "-->"
6363

@@ -118,7 +118,7 @@ pLinkTitle = do
118118
pReference :: Parser (Text, Text, Text)
119119
pReference = do
120120
lab <- pLinkLabel
121-
char ':'
121+
_ <- char ':'
122122
scanSpnl
123123
url <- pLinkUrl
124124
tit <- option T.empty $ scanSpnl >> pLinkTitle
@@ -239,7 +239,7 @@ schemeSet = Set.fromList $ schemes ++ map T.toUpper schemes
239239
-- Parse a URI, using heuristics to avoid capturing final punctuation.
240240
pUri :: Text -> Parser Inlines
241241
pUri scheme = do
242-
char ':'
242+
_ <- char ':'
243243
x <- scan (OpenParens 0) uriScanner
244244
guard $ not $ T.null x
245245
let (rawuri, endingpunct) =
@@ -344,11 +344,11 @@ pLink refmap = do
344344
-- An inline link: [label](/url "optional title")
345345
pInlineLink :: Inlines -> Parser Inlines
346346
pInlineLink lab = do
347-
char '('
347+
_ <- char '('
348348
scanSpaces
349349
url <- pLinkUrl
350350
tit <- option "" $ scanSpnl *> pLinkTitle <* scanSpaces
351-
char ')'
351+
_ <- char ')'
352352
return $ singleton $ Link lab (Url url) tit
353353

354354
-- A reference link: [label], [foo][label], or [label][].
@@ -361,7 +361,7 @@ pReferenceLink _ rawlab lab = do
361361
-- An image: ! followed by a link.
362362
pImage :: ReferenceMap -> Parser Inlines
363363
pImage refmap = do
364-
char '!'
364+
_ <- char '!'
365365
(linkToImage <$> pLink refmap) <|> return (singleton (Str "!"))
366366

367367
linkToImage :: Inlines -> Inlines
@@ -377,23 +377,23 @@ linkToImage ils =
377377
-- convert them to characters and store them as Str inlines.
378378
pEntity :: Parser Inlines
379379
pEntity = do
380-
char '&'
380+
_ <- char '&'
381381
res <- pCharEntity <|> pDecEntity <|> pHexEntity
382-
char ';'
382+
_ <- char ';'
383383
return $ singleton $ Entity $ "&" <> res <> ";"
384384

385385
pCharEntity :: Parser Text
386386
pCharEntity = takeWhile1 (\c -> isAscii c && isLetter c)
387387

388388
pDecEntity :: Parser Text
389389
pDecEntity = do
390-
char '#'
390+
_ <- char '#'
391391
res <- takeWhile1 isDigit
392392
return $ "#" <> res
393393

394394
pHexEntity :: Parser Text
395395
pHexEntity = do
396-
char '#'
396+
_ <- char '#'
397397
x <- char 'X' <|> char 'x'
398398
res <- takeWhile1 isHexDigit
399399
return $ "#" <> T.singleton x <> res

markdown/Cheapskate/Parse.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ containerContinue c =
116116
<|>
117117
(do scanSpacesToColumn
118118
(markerColumn li + 1)
119-
upToCountChars (padding li - 1)
119+
_ <- upToCountChars (padding li - 1)
120120
(==' ')
121121
return ())
122122
Reference{} -> nfb scanBlankline >>
@@ -450,7 +450,7 @@ processLine (lineNumber, txt) = do
450450
-- otherwise, close all the unmatched containers, add the new
451451
-- containers, and finally add the new leaf:
452452
(ns, lf) -> do -- close unmatched containers, add new ones
453-
replicateM numUnmatched closeContainer
453+
_ <- replicateM numUnmatched closeContainer
454454
addNew (ns, lf)
455455

456456
where
@@ -531,7 +531,7 @@ scanBlockquoteStart = scanChar '>' >> option () (scanChar ' ')
531531
-- a header.
532532
parseAtxHeaderStart :: Parser Int
533533
parseAtxHeaderStart = do
534-
char '#'
534+
_ <- char '#'
535535
hashes <- upToCountChars 5 (== '#')
536536
-- hashes must be followed by space unless empty header:
537537
notFollowedBy (skip (/= ' '))
@@ -551,7 +551,7 @@ parseSetextHeaderLine = do
551551
scanHRuleLine :: Scanner
552552
scanHRuleLine = do
553553
c <- satisfy (\c -> c == '*' || c == '_' || c == '-')
554-
count 2 $ scanSpaces >> skip (== c)
554+
_ <- count 2 $ scanSpaces >> skip (== c)
555555
skipWhile (\x -> x == ' ' || x == c)
556556
endOfInput
557557

parser/src/Parse/Helpers.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ failure :: String -> IParser String
507507
failure msg = do
508508
inp <- getInput
509509
setInput ('x':inp)
510-
anyToken
510+
_ <- anyToken
511511
fail msg
512512

513513

0 commit comments

Comments
 (0)