on 52182bc help sign in
project-m36/src/lib/ProjectM36/TypeConstructor.hs
17 lines 636 B history raw
1module ProjectM36.TypeConstructor where
2import ProjectM36.Base
4name :: TypeConstructor -> TypeConstructorName
5name (ADTypeConstructor name' _) = name'
6name (PrimitiveTypeConstructor name' _) = name'
7name (RelationAtomTypeConstructor _) = error "name called on RelationAtomTypeConstructor"
8name (TypeVariable _) = error "name called on TypeVariable" --v --not really the name, but this is used for display only
10arguments :: TypeConstructor -> [TypeConstructor]
11arguments (ADTypeConstructor _ args) = args
12arguments (PrimitiveTypeConstructor _ _) = []
13arguments (RelationAtomTypeConstructor _) = []
14arguments (TypeVariable _) = []