diff options
author | Baldur Blöndal <baldurpet@gmail.com> | 2022-09-22 01:27:53 +0000 |
---|---|---|
committer | Topsii <tobiashaslop@hotmail.de> | 2022-11-30 21:16:36 +0100 |
commit | d87f28d810b9c536ca4db7f363163e6d0dd6c93c (patch) | |
tree | 558597fb2921abf4c201019f9ade7b0037443751 /compiler/GHC/Data/Graph | |
parent | b4cfa8e235715d8c73b2ba0ba05ed8ef92629218 (diff) | |
download | haskell-d87f28d810b9c536ca4db7f363163e6d0dd6c93c.tar.gz |
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.
Diffstat (limited to 'compiler/GHC/Data/Graph')
-rw-r--r-- | compiler/GHC/Data/Graph/Inductive/PatriciaTree.hs | 3 |
1 files changed, 3 insertions, 0 deletions
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 |