module ProjectM36.TypeConstructor where
import ProjectM36.Base

name :: TypeConstructor -> TypeConstructorName
name :: TypeConstructor -> TypeConstructorName
name (ADTypeConstructor TypeConstructorName
name' [TypeConstructor]
_) = TypeConstructorName
name'
name (PrimitiveTypeConstructor TypeConstructorName
name' AtomType
_) = TypeConstructorName
name'
name (RelationAtomTypeConstructor [AttributeExprBase ()]
_) = [Char] -> TypeConstructorName
forall a. HasCallStack => [Char] -> a
error [Char]
"name called on RelationAtomTypeConstructor"
name (TypeVariable TypeConstructorName
_) = [Char] -> TypeConstructorName
forall a. HasCallStack => [Char] -> a
error [Char]
"name called on TypeVariable" --v --not really the name, but this is used for display only

arguments :: TypeConstructor -> [TypeConstructor]
arguments :: TypeConstructor -> [TypeConstructor]
arguments (ADTypeConstructor TypeConstructorName
_ [TypeConstructor]
args) = [TypeConstructor]
args
arguments (PrimitiveTypeConstructor TypeConstructorName
_ AtomType
_) = []
arguments (RelationAtomTypeConstructor [AttributeExprBase ()]
_) = []
arguments (TypeVariable TypeConstructorName
_) = []