From 761e00caa4248fc9682bcb4ee6f9703944e2f37e Mon Sep 17 00:00:00 2001 From: Stephen Morgan Date: Fri, 27 Aug 2021 20:58:02 +1000 Subject: [PATCH] cln: hlint: Clean up lambda related warnings. --- .hlint.yaml | 2 -- hledger-lib/Hledger/Read/Common.hs | 2 +- hledger-ui/Hledger/UI/Main.hs | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.hlint.yaml b/.hlint.yaml index 713653cc5..5699101dc 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -18,8 +18,6 @@ - ignore: {name: "Use fewer imports"} - ignore: {name: "Use tuple-section"} - ignore: {name: "Use section"} -- ignore: {name: "Avoid lambda using `infix`"} -- ignore: {name: "Use lambda-case"} # Specify additional command line arguments diff --git a/hledger-lib/Hledger/Read/Common.hs b/hledger-lib/Hledger/Read/Common.hs index ef9b29bdf..b0238d652 100644 --- a/hledger-lib/Hledger/Read/Common.hs +++ b/hledger-lib/Hledger/Read/Common.hs @@ -1226,7 +1226,7 @@ multilinecommentp = startComment *> anyLine `skipManyTill` endComment endComment = eof <|> string "end comment" *> trailingSpaces trailingSpaces = skipNonNewlineSpaces <* newline - anyLine = void $ takeWhileP Nothing (\c -> c /= '\n') *> newline + anyLine = void $ takeWhileP Nothing (/='\n') *> newline {-# INLINABLE multilinecommentp #-} diff --git a/hledger-ui/Hledger/UI/Main.hs b/hledger-ui/Hledger/UI/Main.hs index 2edc49102..b443f199f 100644 --- a/hledger-ui/Hledger/UI/Main.hs +++ b/hledger-ui/Hledger/UI/Main.hs @@ -3,6 +3,7 @@ hledger-ui - a hledger add-on providing a curses-style interface. Copyright (c) 2007-2015 Simon Michael Released under GPL version 3 or later. -} +{-# LANGUAGE LambdaCase #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE OverloadedStrings #-} @@ -219,7 +220,7 @@ runBrickUi uopts@UIOpts{cliopts_=copts@CliOpts{inputopts_=_iopts,reportspec_=rsp mgr d -- predicate: ignore changes not involving our files - (\fev -> case fev of + (\case Modified f _ False -> f `elem` files -- Added f _ -> f `elem` files -- Removed f _ -> f `elem` files