hydra-0.14.0: src/gen-main/haskell/Hydra/Module.hs
-- Note: this is an automatically generated file. Do not edit.
-- | A model for Hydra namespaces and modules
module Hydra.Module where
import qualified Hydra.Core as Core
import qualified Hydra.Graph as Graph
import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum)
import qualified Data.ByteString as B
import qualified Data.Int as I
import qualified Data.List as L
import qualified Data.Map as M
import qualified Data.Set as S
-- | A definition, which may be either a term or type definition
data Definition =
-- | A term definition
DefinitionTerm TermDefinition |
-- | A type definition
DefinitionType TypeDefinition
deriving (Eq, Ord, Read, Show)
_Definition = Core.Name "hydra.module.Definition"
_Definition_term = Core.Name "term"
_Definition_type = Core.Name "type"
-- | A file extension (without the dot), e.g. "json" or "py"
newtype FileExtension =
FileExtension {
unFileExtension :: String}
deriving (Eq, Ord, Read, Show)
_FileExtension = Core.Name "hydra.module.FileExtension"
-- | A library of primitive functions
data Library =
Library {
-- | A common prefix for all primitive function names in the library
libraryNamespace :: Namespace,
-- | A preferred namespace prefix for function names in the library
libraryPrefix :: String,
-- | The primitives defined in this library
libraryPrimitives :: [Graph.Primitive]}
_Library = Core.Name "hydra.module.Library"
_Library_namespace = Core.Name "namespace"
_Library_prefix = Core.Name "prefix"
_Library_primitives = Core.Name "primitives"
-- | A logical collection of elements in the same namespace, having dependencies on zero or more other modules
data Module =
Module {
-- | A common prefix for all element names in the module
moduleNamespace :: Namespace,
-- | The definitions in this module
moduleDefinitions :: [Definition],
-- | Any modules which the term expressions of this module directly depend upon
moduleTermDependencies :: [Namespace],
-- | Any modules which the type expressions of this module directly depend upon
moduleTypeDependencies :: [Namespace],
-- | An optional human-readable description of the module
moduleDescription :: (Maybe String)}
deriving (Eq, Ord, Read, Show)
_Module = Core.Name "hydra.module.Module"
_Module_namespace = Core.Name "namespace"
_Module_definitions = Core.Name "definitions"
_Module_termDependencies = Core.Name "termDependencies"
_Module_typeDependencies = Core.Name "typeDependencies"
_Module_description = Core.Name "description"
-- | A prefix for element names
newtype Namespace =
Namespace {
unNamespace :: String}
deriving (Eq, Ord, Read, Show)
_Namespace = Core.Name "hydra.module.Namespace"
-- | A mapping from namespaces to values of type n, with a focus on one namespace
data Namespaces n =
Namespaces {
-- | The namespace in focus, together with its associated value
namespacesFocus :: (Namespace, n),
-- | A mapping of namespaces to values
namespacesMapping :: (M.Map Namespace n)}
deriving (Eq, Ord, Read, Show)
_Namespaces = Core.Name "hydra.module.Namespaces"
_Namespaces_focus = Core.Name "focus"
_Namespaces_mapping = Core.Name "mapping"
-- | A qualified name consisting of an optional namespace together with a mandatory local name
data QualifiedName =
QualifiedName {
-- | The optional namespace
qualifiedNameNamespace :: (Maybe Namespace),
-- | The local name
qualifiedNameLocal :: String}
deriving (Eq, Ord, Read, Show)
_QualifiedName = Core.Name "hydra.module.QualifiedName"
_QualifiedName_namespace = Core.Name "namespace"
_QualifiedName_local = Core.Name "local"
-- | A term-level definition, including a name, a term, and the type scheme of the term
data TermDefinition =
TermDefinition {
-- | The name of the term
termDefinitionName :: Core.Name,
-- | The term being defined
termDefinitionTerm :: Core.Term,
-- | The type scheme of the term, including any class constraints
termDefinitionType :: (Maybe Core.TypeScheme)}
deriving (Eq, Ord, Read, Show)
_TermDefinition = Core.Name "hydra.module.TermDefinition"
_TermDefinition_name = Core.Name "name"
_TermDefinition_term = Core.Name "term"
_TermDefinition_type = Core.Name "type"
-- | A type-level definition, including a name and the type
data TypeDefinition =
TypeDefinition {
-- | The name of the type
typeDefinitionName :: Core.Name,
-- | The type being defined
typeDefinitionType :: Core.Type}
deriving (Eq, Ord, Read, Show)
_TypeDefinition = Core.Name "hydra.module.TypeDefinition"
_TypeDefinition_name = Core.Name "name"
_TypeDefinition_type = Core.Name "type"