Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit 6cb9af2

Browse files
committed
Correct the Monoid instance for ScopeGraph.
1 parent 3bf6cb6 commit 6cb9af2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

semantic-core/src/Analysis/ScopeGraph.hs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE FlexibleContexts, GeneralizedNewtypeDeriving, OverloadedStrings, RankNTypes, RecordWildCards, TypeApplications, TypeOperators #-}
1+
{-# LANGUAGE FlexibleContexts, OverloadedStrings, RankNTypes, RecordWildCards, TypeApplications, TypeOperators #-}
22
module Analysis.ScopeGraph
33
( ScopeGraph(..)
44
, Entry(..)
@@ -34,11 +34,14 @@ data Entry = Entry
3434
deriving (Eq, Ord, Show)
3535

3636
newtype ScopeGraph = ScopeGraph { unScopeGraph :: Map.Map Entry (Set.Set Entry) }
37-
deriving (Eq, Monoid, Ord, Show)
37+
deriving (Eq, Ord, Show)
3838

3939
instance Semigroup ScopeGraph where
4040
ScopeGraph a <> ScopeGraph b = ScopeGraph (Map.unionWith (<>) a b)
4141

42+
instance Monoid ScopeGraph where
43+
mempty = ScopeGraph Map.empty
44+
4245
scopeGraph
4346
:: Ord term
4447
=> (forall sig m

0 commit comments

Comments
 (0)