cln: hlint: Remove redundant where and lambda warnings.
This commit is contained in:
		
							parent
							
								
									71032c637e
								
							
						
					
					
						commit
						eb6047e81b
					
				| @ -40,7 +40,6 @@ | |||||||
| - ignore: {name: "Use section"} | - ignore: {name: "Use section"} | ||||||
| - ignore: {name: "Use maybe"} | - ignore: {name: "Use maybe"} | ||||||
| - ignore: {name: "Fuse concatMap/map"} | - ignore: {name: "Fuse concatMap/map"} | ||||||
| - ignore: {name: "Redundant where"} |  | ||||||
| - ignore: {name: "Use concatMap"} | - ignore: {name: "Use concatMap"} | ||||||
| - ignore: {name: "Redundant bang pattern"} | - ignore: {name: "Redundant bang pattern"} | ||||||
| - ignore: {name: "Use zipWith"} | - ignore: {name: "Use zipWith"} | ||||||
| @ -57,7 +56,6 @@ | |||||||
| - ignore: {name: "Use elemIndex"} | - ignore: {name: "Use elemIndex"} | ||||||
| - ignore: {name: "Use =="} | - ignore: {name: "Use =="} | ||||||
| - ignore: {name: "Use lambda-case"} | - ignore: {name: "Use lambda-case"} | ||||||
| - ignore: {name: "Redundant lambda"} |  | ||||||
| - ignore: {name: "Replace case with fromMaybe"} | - ignore: {name: "Replace case with fromMaybe"} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -272,7 +272,7 @@ outputFileOption = | |||||||
| -- uses unsafePerformIO. | -- uses unsafePerformIO. | ||||||
| traceAt :: Int -> String -> a -> a | traceAt :: Int -> String -> a -> a | ||||||
| traceAt level | traceAt level | ||||||
|     | level > 0 && debugLevel < level = flip const |     | level > 0 && debugLevel < level = const id | ||||||
|     | otherwise = trace |     | otherwise = trace | ||||||
| 
 | 
 | ||||||
| -- | Trace (print to stderr) a showable value using a custom show function, | -- | Trace (print to stderr) a showable value using a custom show function, | ||||||
| @ -286,7 +286,7 @@ traceAtWith level f a = traceAt level (f a) a | |||||||
| -- At level 0, always prints. Otherwise, uses unsafePerformIO. | -- At level 0, always prints. Otherwise, uses unsafePerformIO. | ||||||
| ptraceAt :: Show a => Int -> String -> a -> a | ptraceAt :: Show a => Int -> String -> a -> a | ||||||
| ptraceAt level | ptraceAt level | ||||||
|     | level > 0 && debugLevel < level = flip const |     | level > 0 && debugLevel < level = const id | ||||||
|     | otherwise = \s a -> let p = pshow a |     | otherwise = \s a -> let p = pshow a | ||||||
|                               ls = lines p |                               ls = lines p | ||||||
|                               nlorspace | length ls > 1 = "\n" |                               nlorspace | length ls > 1 = "\n" | ||||||
|  | |||||||
| @ -283,8 +283,7 @@ topBottomBorderWithLabels toplabel bottomlabel body = | |||||||
| -- XXX May disrupt border style of inner widgets. | -- XXX May disrupt border style of inner widgets. | ||||||
| -- XXX Should reduce the available size visible to inner widget, but doesn't seem to (cf rsDraw2). | -- XXX Should reduce the available size visible to inner widget, but doesn't seem to (cf rsDraw2). | ||||||
| margin :: Int -> Int -> Maybe Color -> Widget Name -> Widget Name | margin :: Int -> Int -> Maybe Color -> Widget Name -> Widget Name | ||||||
| margin h v mcolour = \w -> | margin h v mcolour w = Widget Greedy Greedy $ do | ||||||
|   Widget Greedy Greedy $ do |  | ||||||
|     c <- getContext |     c <- getContext | ||||||
|     let w' = vLimit (c^.availHeightL - v*2) $ hLimit (c^.availWidthL - h*2) w |     let w' = vLimit (c^.availHeightL - v*2) $ hLimit (c^.availWidthL - h*2) w | ||||||
|         attr = maybe currentAttr (\c -> c `on` c) mcolour |         attr = maybe currentAttr (\c -> c `on` c) mcolour | ||||||
|  | |||||||
| @ -106,7 +106,6 @@ addForm j today = identifyForm "add" $ \extra -> do | |||||||
|           ) ts, |           ) ts, | ||||||
|         "]" |         "]" | ||||||
|         ] |         ] | ||||||
|       where |  | ||||||
| b64wrap :: Text -> Text | b64wrap :: Text -> Text | ||||||
| b64wrap = ("atob(\""<>) . (<>"\")") . encodeBase64 | b64wrap = ("atob(\""<>) . (<>"\")") . encodeBase64 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -103,7 +103,7 @@ renderPatch = go Nothing . sortOn fst where | |||||||
|     go (Just (fp, _)) cs@((sourceFilePath -> fp', _):_) | fp /= fp' = go Nothing cs |     go (Just (fp, _)) cs@((sourceFilePath -> fp', _):_) | fp /= fp' = go Nothing cs | ||||||
|     go (Just (fp, offs)) ((sourceFirstLine -> lineno, diffs):cs) = chunkHeader <> chunk <> go (Just (fp, offs + adds - dels)) cs |     go (Just (fp, offs)) ((sourceFirstLine -> lineno, diffs):cs) = chunkHeader <> chunk <> go (Just (fp, offs + adds - dels)) cs | ||||||
|         where |         where | ||||||
|             chunkHeader = T.pack $ printf "@@ -%d,%d +%d,%d @@\n" lineno dels (lineno+offs) adds where |             chunkHeader = T.pack $ printf "@@ -%d,%d +%d,%d @@\n" lineno dels (lineno+offs) adds | ||||||
|             (dels, adds) = foldl' countDiff (0, 0) diffs |             (dels, adds) = foldl' countDiff (0, 0) diffs | ||||||
|             chunk = foldMap renderLine diffs |             chunk = foldMap renderLine diffs | ||||||
|     fileHeader fp = "--- " <> T.pack fp <> "\n+++ " <> T.pack fp <> "\n" |     fileHeader fp = "--- " <> T.pack fp <> "\n+++ " <> T.pack fp <> "\n" | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user