From a30f516829d75a921acf3510a0468e8272cf6ae4 Mon Sep 17 00:00:00 2001 From: Matthijs Blom <19817960+MatthijsBlom@users.noreply.github.com> Date: Thu, 14 Sep 2023 15:30:19 +0200 Subject: [PATCH] Correct Functor law hint --- data/hlint.yaml | 3 ++- hints.md | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/data/hlint.yaml b/data/hlint.yaml index a3a0695e..6dbdf917 100644 --- a/data/hlint.yaml +++ b/data/hlint.yaml @@ -472,11 +472,12 @@ # FUNCTOR - warn: {lhs: fmap f (fmap g x), rhs: fmap (f . g) x, name: Functor law} - - warn: {lhs: f <$> g <$> x, rhs: f . g <$> x, name: Functor law} + - warn: {lhs: f <$> (g <$> x), rhs: f . g <$> x, name: Functor law} - warn: {lhs: x <&> g <&> f, rhs: x <&> f . g, name: Functor law} - warn: {lhs: fmap id, rhs: id, name: Functor law} - warn: {lhs: id <$> x, rhs: x, name: Functor law} - warn: {lhs: x <&> id, rhs: x, name: Functor law} + - warn: {lhs: f <$> g <$> x, rhs: f . g <$> x} - hint: {lhs: fmap f $ x, rhs: f <$> x, side: isApp x || isAtom x} - hint: {lhs: \x -> a <$> b x, rhs: fmap a . b} - hint: {lhs: \x -> b x <&> a, rhs: fmap a . b} diff --git a/hints.md b/hints.md index 0caab1d9..960a0e28 100644 --- a/hints.md +++ b/hints.md @@ -7226,7 +7226,7 @@ fmap (f . g) x
-f <$> g <$> x
+f <$> (g <$> x)
+f <$> g <$> x
+
+
+f . g <$> x
+
+