Skip to content

Commit 40574d2

Browse files
committed
HLint fix: "Redundant $"
1 parent 1e28933 commit 40574d2

17 files changed

Lines changed: 34 additions & 35 deletions

File tree

.hlint.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
- ignore: {name: "Use lambda-case"}
1717
- ignore: {name: "Avoid lambda"}
1818
- ignore: {name: "Use tuple-section"}
19-
- ignore: {name: "Redundant $"}
2019
- ignore: {name: "Use record patterns"}
2120
- ignore: {name: "Move brackets to avoid $"}
2221
- ignore: {name: "Use section"}

lib/purescript-ast/src/Language/PureScript/Types.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ everywhereOnTypes f = go where
595595
go (TypeApp ann t1 t2) = f (TypeApp ann (go t1) (go t2))
596596
go (KindApp ann t1 t2) = f (KindApp ann (go t1) (go t2))
597597
go (ForAll ann arg mbK ty sco) = f (ForAll ann arg (go <$> mbK) (go ty) sco)
598-
go (ConstrainedType ann c ty) = f (ConstrainedType ann (mapConstraintArgsAll (map go) $ c) (go ty))
598+
go (ConstrainedType ann c ty) = f (ConstrainedType ann (mapConstraintArgsAll (map go) c) (go ty))
599599
go (RCons ann name ty rest) = f (RCons ann name (go ty) (go rest))
600600
go (KindedType ann ty k) = f (KindedType ann (go ty) (go k))
601601
go (BinaryNoParensType ann t1 t2 t3) = f (BinaryNoParensType ann (go t1) (go t2) (go t3))

lib/purescript-cst/src/Language/PureScript/CST/Convert.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ convertType fileName = go
121121
TypeHole _ a ->
122122
T.TypeWildcard (sourceName fileName a) . Just . getIdent $ nameValue a
123123
TypeString _ a b ->
124-
T.TypeLevelString (sourceAnnCommented fileName a a) $ b
124+
T.TypeLevelString (sourceAnnCommented fileName a a) b
125125
TypeRow _ (Wrapped _ row b) ->
126126
goRow row b
127127
TypeRecord _ (Wrapped a row b) -> do

lib/purescript-cst/src/Language/PureScript/CST/Lexer.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ breakComments = k0 []
204204
comment = isBlockComment >>= \case
205205
Just True -> Just <$> blockComment "{-"
206206
Just False -> Just <$> lineComment "--"
207-
Nothing -> pure $ Nothing
207+
Nothing -> pure Nothing
208208

209209
lineComment acc = do
210210
comm <- nextWhile (\c -> c /= '\r' && c /= '\n')
@@ -417,15 +417,15 @@ token = peek >>= maybe (pure TokEof) k0
417417
Just ch ->
418418
next $> (Text.singleton ch, ch)
419419
Nothing ->
420-
throw $ ErrEof
420+
throw ErrEof
421421
peek >>= \case
422422
Just '\''
423423
| fromEnum ch > 0xFFFF -> throw ErrAstralCodePointInChar
424424
| otherwise -> next $> TokChar raw ch
425425
Just ch2 ->
426426
throw $ ErrLexeme (Just [ch2]) []
427427
_ ->
428-
throw $ ErrEof
428+
throw ErrEof
429429

430430
{-
431431
stringPart
@@ -571,7 +571,7 @@ token = peek >>= maybe (pure TokEof) k0
571571
Just ch | isNumberChar ch -> throw ErrLeadingZero
572572
_ -> pure $ Just ("0", "0")
573573
Just ch | Char.isDigit ch -> Just <$> digits
574-
_ -> pure $ Nothing
574+
_ -> pure Nothing
575575

576576
{-
577577
integer1
@@ -589,7 +589,7 @@ token = peek >>= maybe (pure TokEof) k0
589589
ch | Char.isDigit ch -> do
590590
(raw, chs) <- digits
591591
pure $ Just (Text.cons ch raw, ch : chs)
592-
_ -> pure $ Nothing
592+
_ -> pure Nothing
593593

594594
{-
595595
fraction

lib/purescript-cst/src/Language/PureScript/CST/Monad.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ manyDelimited open close sep p = do
157157
_ <- token open
158158
res <- go1
159159
_ <- token close
160-
pure $ res
160+
pure res
161161
where
162162
go1 =
163163
oneOf $ NE.fromList

src/Language/PureScript/CodeGen/JS/Printer.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ literals = mkPattern' match'
122122
match _ = mzero
123123

124124
comment :: (Emit gen) => Comment -> StateT PrinterState Maybe gen
125-
comment (LineComment com) = fmap mconcat $ sequence $
125+
comment (LineComment com) = fmap mconcat $ sequence
126126
[ currentIndent
127127
, return $ emit "//" <> emit com <> emit "\n"
128128
]

src/Language/PureScript/Errors.hs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs relPath) e = fl
698698
paras [ line $ "In the FFI module for " <> markCode (runModuleName mn) <> ":"
699699
, indent . paras $
700700
[ line $ "The identifier " <> markCode ident <> " contains a prime (" <> markCode "'" <> ")."
701-
, line $ "Primes in identifiers exported from FFI modules are deprecated and won’t be supported in the future."
701+
, line "Primes in identifiers exported from FFI modules are deprecated and won’t be supported in the future."
702702
]
703703
]
704704
renderSimpleErrorMessage InvalidDoBind =
@@ -793,14 +793,14 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs relPath) e = fl
793793
renderSimpleErrorMessage (CycleInTypeClassDeclaration [name]) =
794794
paras [ line $ "A type class '" <> markCode (runProperName (disqualify name)) <> "' may not have itself as a superclass." ]
795795
renderSimpleErrorMessage (CycleInTypeClassDeclaration names) =
796-
paras [ line $ "A cycle appears in a set of type class definitions:"
796+
paras [ line "A cycle appears in a set of type class definitions:"
797797
, indent $ line $ "{" <> T.intercalate ", " (map (markCode . runProperName . disqualify) names) <> "}"
798798
, line "Cycles are disallowed because they can lead to loops in the type checker."
799799
]
800800
renderSimpleErrorMessage (CycleInKindDeclaration [name]) =
801801
paras [ line $ "A kind declaration '" <> markCode (runProperName (disqualify name)) <> "' may not refer to itself in its own signature." ]
802802
renderSimpleErrorMessage (CycleInKindDeclaration names) =
803-
paras [ line $ "A cycle appears in a set of kind declarations:"
803+
paras [ line "A cycle appears in a set of kind declarations:"
804804
, indent $ line $ "{" <> T.intercalate ", " (map (markCode . runProperName . disqualify) names) <> "}"
805805
, line "Kind declarations may not refer to themselves in their own signatures."
806806
]
@@ -949,7 +949,7 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs relPath) e = fl
949949
[ line (showQualified runProperName nm)
950950
, Box.vcat Box.left (map prettyTypeAtom ts)
951951
]
952-
, line $ fold $
952+
, line $ fold
953953
[ "because the "
954954
, markCode (showQualified runProperName nm)
955955
, " type class has "
@@ -985,11 +985,11 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs relPath) e = fl
985985
renderSimpleErrorMessage (OverlappingArgNames ident) =
986986
line $ "Overlapping names in function/binder" <> foldMap ((" in declaration " <>) . showIdent) ident
987987
renderSimpleErrorMessage (MissingClassMember identsAndTypes) =
988-
paras $ [ line "The following type class members have not been implemented:"
989-
, Box.vcat Box.left
990-
[ markCodeBox $ Box.text (T.unpack (showIdent ident)) Box.<> " :: " Box.<> prettyType ty
991-
| (ident, ty) <- NEL.toList identsAndTypes ]
992-
]
988+
paras [ line "The following type class members have not been implemented:"
989+
, Box.vcat Box.left
990+
[ markCodeBox $ Box.text (T.unpack (showIdent ident)) Box.<> " :: " Box.<> prettyType ty
991+
| (ident, ty) <- NEL.toList identsAndTypes ]
992+
]
993993
renderSimpleErrorMessage (ExtraneousClassMember ident className) =
994994
line $ "" <> markCode (showIdent ident) <> " is not a member of type class " <> markCode (showQualified runProperName className)
995995
renderSimpleErrorMessage (ExpectedType ty kind) =
@@ -1107,7 +1107,7 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs relPath) e = fl
11071107
renderSimpleErrorMessage (MissingKindDeclaration sig name ty) =
11081108
let sigKw = prettyPrintKindSignatureFor sig in
11091109
paras [ line $ "The inferred kind for the " <> sigKw <> " declaration " <> markCode (runProperName name) <> " contains polymorphic kinds."
1110-
, line $ "Consider adding a top-level kind signature as a form of documentation."
1110+
, line "Consider adding a top-level kind signature as a form of documentation."
11111111
, markCodeBox $ indent $ Box.hsep 1 Box.left
11121112
[ line $ sigKw <> " " <> runProperName name <> " ::"
11131113
, prettyTypeWithDepth maxBound ty
@@ -1173,7 +1173,7 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs relPath) e = fl
11731173
]
11741174
renderSimpleErrorMessage msg@(ImplicitQualifiedImportReExport importedModule asModule _) =
11751175
paras [ line $ "Module " <> markCode (runModuleName importedModule) <> " was imported as " <> markCode (runModuleName asModule) <> " with unspecified imports."
1176-
, line $ "As this module is being re-exported, consider using the explicit form:"
1176+
, line "As this module is being re-exported, consider using the explicit form:"
11771177
, indent $ line $ markCode $ showSuggestion msg
11781178
]
11791179

@@ -1252,9 +1252,9 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs relPath) e = fl
12521252
]
12531253

12541254
renderSimpleErrorMessage (CannotDefinePrimModules mn) =
1255-
paras $
1255+
paras
12561256
[ line $ "The module name " <> markCode (runModuleName mn) <> " is in the Prim namespace."
1257-
, line $ "The Prim namespace is reserved for compiler-defined terms."
1257+
, line "The Prim namespace is reserved for compiler-defined terms."
12581258
]
12591259

12601260
renderSimpleErrorMessage (MixedAssociativityError opsWithAssoc) =
@@ -1300,7 +1300,7 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs relPath) e = fl
13001300
renderSimpleErrorMessage (VisibleQuantificationCheckFailureInType var) =
13011301
paras
13021302
[ line $ "Visible dependent quantification of type variable " <> markCode var <> " is not supported."
1303-
, line $ "If you would like this feature supported, please bother Liam Goodacre (@LiamGoodacre)."
1303+
, line "If you would like this feature supported, please bother Liam Goodacre (@LiamGoodacre)."
13041304
]
13051305

13061306
renderSimpleErrorMessage (UnsupportedTypeInKind ty) =
@@ -1330,7 +1330,7 @@ prettyPrintSingleError (PPEOptions codeColor full level showDocs relPath) e = fl
13301330
]
13311331

13321332
renderSimpleErrorMessage UnsupportedRoleDeclaration =
1333-
line $ "Role declarations are only supported for data types, not for type synonyms nor type classes."
1333+
line "Role declarations are only supported for data types, not for type synonyms nor type classes."
13341334

13351335
renderSimpleErrorMessage (RoleDeclarationArityMismatch name expected actual) =
13361336
line $ T.intercalate " "

src/Language/PureScript/Linter/Exhaustive.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ checkExhaustive ss env mn numArgs cas expr = makeResult . first ordNub $ foldl'
293293
where
294294
partial :: Text -> Text -> Declaration
295295
partial var tyVar =
296-
ValueDecl (ss, []) UnusedIdent Private [] $
296+
ValueDecl (ss, []) UnusedIdent Private []
297297
[MkUnguarded
298298
(TypedValue
299299
True

src/Language/PureScript/Sugar/Names/Exports.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ resolveExports env ss mn imps exps refs =
217217
resolve f (Qualified (Just mn'') a) = do
218218
exps' <- envModuleExports <$> mn'' `M.lookup` env
219219
src <- a `M.lookup` f exps'
220-
return $ (a, src { exportSourceImportedFrom = Just mn'' })
220+
return (a, src { exportSourceImportedFrom = Just mn'' })
221221
resolve _ _ = internalError "Unqualified value in resolve"
222222

223223
-- |

src/Language/PureScript/Sugar/TypeClasses.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ typeClassMemberToDictionaryAccessor
288288
-> Declaration
289289
typeClassMemberToDictionaryAccessor mn name args (TypeDeclaration (TypeDeclarationData sa ident ty)) =
290290
let className = Qualified (Just mn) name
291-
in ValueDecl sa ident Private [] $
291+
in ValueDecl sa ident Private []
292292
[MkUnguarded (
293293
TypedValue False (TypeClassDictionaryAccessor className ident) $
294294
moveQuantifiersToFront (quantify (srcConstrainedType (srcConstraint className [] (map (srcTypeVar . fst) args) Nothing) ty))

0 commit comments

Comments
 (0)