{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE UndecidableInstances #-}
module Data.Equality.Graph.Classes
( module Data.Equality.Graph.Classes
, module Data.Equality.Graph.Classes.Id
) where
import qualified Data.Set as S
import Data.Equality.Graph.Classes.Id
import Data.Equality.Graph.Nodes
import Data.Equality.Utils.SizedList
data EClass analysis_domain language = EClass
{ forall analysis_domain (language :: * -> *).
EClass analysis_domain language -> ClassId
eClassId :: {-# UNPACK #-} !ClassId
, forall analysis_domain (language :: * -> *).
EClass analysis_domain language -> Set (ENode language)
eClassNodes :: !(S.Set (ENode language))
, forall analysis_domain (language :: * -> *).
EClass analysis_domain language -> analysis_domain
eClassData :: analysis_domain
, forall analysis_domain (language :: * -> *).
EClass analysis_domain language -> SList (ClassId, ENode language)
eClassParents :: !(SList (ClassId, ENode language))
}
instance (Show a, Show (l ClassId)) => Show (EClass a l) where
show :: EClass a l -> String
show (EClass ClassId
a Set (ENode l)
b a
d (SList [(ClassId, ENode l)]
c ClassId
_)) = String
"Id: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> ClassId -> String
forall a. Show a => a -> String
show ClassId
a String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"\nNodes: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Set (ENode l) -> String
forall a. Show a => a -> String
show Set (ENode l)
b String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"\nParents: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> [(ClassId, ENode l)] -> String
forall a. Show a => a -> String
show [(ClassId, ENode l)]
c String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"\nData: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> a -> String
forall a. Show a => a -> String
show a
d