From 058b252c4c70f31387cbfd2f0056f94d0cf73919 Mon Sep 17 00:00:00 2001 From: Georgi Lyubenov Date: Fri, 6 Oct 2023 11:20:40 +0300 Subject: [PATCH] Add hints for replacing some `maybe` usage with equivalent `traverse` --- data/hlint.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/hlint.yaml b/data/hlint.yaml index a3a0695e..8a5cd25a 100644 --- a/data/hlint.yaml +++ b/data/hlint.yaml @@ -752,6 +752,10 @@ - warn: {lhs: lefts (nubOrd x), rhs: nubOrd (lefts x), name: Move nubOrd out} - warn: {lhs: rights (nubOrd x), rhs: nubOrd (rights x), name: Move nubOrd out} - warn: {lhs: filter f (reverse x), rhs: reverse (filter f x), name: Move reverse out} + - warn: {lhs: maybe (pure Nothing) (fmap Just . f), rhs: traverse f} + - warn: {lhs: maybe (pure Nothing) ((Just <$>) . f), rhs: traverse f} + - warn: {lhs: maybe (pure Nothing) (\x -> fmap Just (f x)), rhs: traverse f} + - warn: {lhs: maybe (pure Nothing) (\x -> Just <$> f x), rhs: traverse f} # EITHER