From d87f28d810b9c536ca4db7f363163e6d0dd6c93c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Baldur=20Bl=C3=B6ndal?= Date: Thu, 22 Sep 2022 01:27:53 +0000 Subject: Make Functor a quantified superclass of Bifunctor. See https://github.com/haskell/core-libraries-committee/issues/91 for discussion. This change relates Bifunctor with Functor by requiring second = fmap. Moreover this change is a step towards unblocking the major version bump of bifunctors and profunctors to major version 6. This paves the way to move the Profunctor class into base. For that Functor first similarly becomes a superclass of Profunctor in the new major version 6. --- compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/GHC/Data/Graph') diff --git a/compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs b/compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs index 626a1dd76b..2a58138044 100644 --- a/compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs +++ b/compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs @@ -116,6 +116,9 @@ instance DynGraph Gr where in Gr g3 +instance Functor (Gr a) where + fmap = fastEMap + instance Bifunctor Gr where bimap = fastNEMap -- cgit v1.2.1