Constructors
Instances2Data, Outputable
Data RoughMatchTcDefined in ghc-9.10.3 · GHC.Core.RoughMapOutputable RoughMatchTcDefined in ghc-9.10.3 · GHC.Core.RoughMap
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Moduleghc-9.10.3GHC2021
RoughMap is an approximate finite map data structure keyed on
[RoughMatchTc]. This is useful when keying maps on lists of Types
(e.g. an instance head).
Data RoughMatchTcDefined in ghc-9.10.3 · GHC.Core.RoughMapOutputable RoughMatchTcDefined in ghc-9.10.3 · GHC.Core.RoughMapRML_KnownTc NameThe position only matches the specified KnownTc
RML_NoKnownTcThe position definitely doesn't match any KnownTc
RML_WildCardThe position can match anything
Data RoughMatchLookupTcDefined in ghc-9.10.3 · GHC.Core.RoughMapOutputable RoughMatchLookupTcDefined in ghc-9.10.3 · GHC.Core.RoughMapTrie of [RoughMatchTc]
Examples*
insert [OtherTc] 1
insert [OtherTc] 2
lookup [OtherTc] == [1,2]
Functor RoughMapDefined in ghc-9.10.3 · GHC.Core.RoughMapOutputable a => Outputable (RoughMap a)Defined in ghc-9.10.3 · GHC.Core.RoughMapOrder of result is deterministic.
N.B. Returns a Bag for matches, which allows us to avoid rebuilding all of the lists
we find in rm_empty, which would otherwise be necessary due to ++ if we
returned a list. We use a list for unifiers because the tail is computed lazily and
we often only care about the first couple of potential unifiers. Constructing a
bag forces the tail which performs much too much work.
See Note [Matching a RoughMap] See Note [Matches vs Unifiers]
Filter all elements that might match a particular key with the given predicate.