module ProjectM36.TypeConstructor where
import ProjectM36.Base
name :: TypeConstructor -> TypeConstructorName
name (ADTypeConstructor name' _) = name'
name (PrimitiveTypeConstructor name' _) = name'
name (RelationAtomTypeConstructor _) = error "name called on RelationAtomTypeConstructor"
name (TypeVariable _) = error "name called on TypeVariable"
arguments :: TypeConstructor -> [TypeConstructor]
arguments (ADTypeConstructor _ args) = args
arguments (PrimitiveTypeConstructor _ _) = []
arguments (RelationAtomTypeConstructor _) = []
arguments (TypeVariable _) = []