mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Correct the Monoid instance for ScopeGraph.
This commit is contained in:
parent
3bf6cb61fd
commit
6cb9af299e
@ -1,4 +1,4 @@
|
||||
{-# LANGUAGE FlexibleContexts, GeneralizedNewtypeDeriving, OverloadedStrings, RankNTypes, RecordWildCards, TypeApplications, TypeOperators #-}
|
||||
{-# LANGUAGE FlexibleContexts, OverloadedStrings, RankNTypes, RecordWildCards, TypeApplications, TypeOperators #-}
|
||||
module Analysis.ScopeGraph
|
||||
( ScopeGraph(..)
|
||||
, Entry(..)
|
||||
@ -34,11 +34,14 @@ data Entry = Entry
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
newtype ScopeGraph = ScopeGraph { unScopeGraph :: Map.Map Entry (Set.Set Entry) }
|
||||
deriving (Eq, Monoid, Ord, Show)
|
||||
deriving (Eq, Ord, Show)
|
||||
|
||||
instance Semigroup ScopeGraph where
|
||||
ScopeGraph a <> ScopeGraph b = ScopeGraph (Map.unionWith (<>) a b)
|
||||
|
||||
instance Monoid ScopeGraph where
|
||||
mempty = ScopeGraph Map.empty
|
||||
|
||||
scopeGraph
|
||||
:: Ord term
|
||||
=> (forall sig m
|
||||
|
Loading…
Reference in New Issue
Block a user