ddc-build-0.4.2.2: Disciplined Disciple Compiler build framework.

Safe HaskellNone
LanguageHaskell98

DDC.Build.Interface.Store

Synopsis

Documentation

data Store Source

Abstract API to a collection of module interfaces.

This lives in IO land because in future we want to demand-load the inferface files as needed, rather than loading the full dependency tree. Keeping it in IO means that callers must also be in IO.

new :: IO Store Source

An empty interface store.

wrap :: Store -> InterfaceAA -> IO () Source

Add a pre-loaded interface file to the store.

load :: FilePath -> IO (Either Error InterfaceAA) Source

Load a new interface from a file.

data Meta Source

Metadata for interfaces currently loaded into the store.

getMeta :: Store -> IO [Meta] Source

Get metadata of interfaces currently in the store.

getModuleNames :: Store -> IO [ModuleName] Source

Get names of the modules currently in the store.

getInterfaces :: Store -> IO [InterfaceAA] Source

Get the fully loaded interfaces.

data Super Source

Interface for some top-level super.

Constructors

Super 

Fields

superName :: Name

Name of the super.

superModuleName :: ModuleName

Where the super was imported from.

This is the module that the name was resolved from. If that module re-exported an imported name then this may not be the module the super was actually defined in.

superTetraType :: Type Name

Tetra type for the super.

superSaltType :: Type Name

Salt type for the super.

superImportValue :: ImportValue Name

Import source for the super.

This can be used to refer to the super from a client module.

findSuper Source

Arguments

:: Store 
-> Name

Name of desired super.

-> [ModuleName]

Names of modules to search.

-> IO [Super] 

See if a super is defined in any of the given modules, and if so return the module name and super type.

NOTE: This function returns an IO [Super] in preparation for the case where we load data from interface files on demand. We want to ensure that the caller is also in IO, to make the refactoring easier later.