module DDC.Type.Check.Config
( Config (..)
, configOfProfile)
where
import DDC.Type.DataDef
import DDC.Type.Env (KindEnv, TypeEnv)
import qualified DDC.Core.Fragment as F
data Config n
= Config
{
configPrimKinds :: KindEnv n
, configPrimTypes :: TypeEnv n
, configDataDefs :: DataDefs n
, configTrackedEffects :: Bool
, configTrackedClosures :: Bool
, configFunctionalEffects :: Bool
, configFunctionalClosures :: Bool
, configEffectCapabilities :: Bool
, configNameIsHole :: Maybe (n -> Bool) }
configOfProfile :: F.Profile n -> Config n
configOfProfile profile
= Config
{ configPrimKinds = F.profilePrimKinds profile
, configPrimTypes = F.profilePrimTypes profile
, configDataDefs = F.profilePrimDataDefs profile
, configTrackedEffects = F.featuresTrackedEffects
$ F.profileFeatures profile
, configTrackedClosures = F.featuresTrackedClosures
$ F.profileFeatures profile
, configFunctionalEffects = F.featuresFunctionalEffects
$ F.profileFeatures profile
, configFunctionalClosures = F.featuresFunctionalClosures
$ F.profileFeatures profile
, configEffectCapabilities = F.featuresEffectCapabilities
$ F.profileFeatures profile
, configNameIsHole = F.profileNameIsHole profile }