@@ -21,18 +21,18 @@ data Declaration
2121 | DeclType
2222 { comments :: Maybe Comments
2323 , head :: DataHead
24- , type_ :: Type
24+ , type_ :: PSType
2525 }
2626 | DeclNewtype
2727 { comments :: Maybe Comments
2828 , head :: DataHead
2929 , name :: ProperName ProperNameType_ConstructorName
30- , type_ :: Type
30+ , type_ :: PSType
3131 }
3232 | DeclClass
3333 { comments :: Maybe Comments
3434 , head :: ClassHead
35- , methods :: Array { ident :: Ident , type_ :: Type }
35+ , methods :: Array { ident :: Ident , type_ :: PSType }
3636 }
3737 | DeclInstanceChain
3838 { comments :: Maybe Comments
@@ -46,7 +46,7 @@ data Declaration
4646 | DeclSignature
4747 { comments :: Maybe Comments
4848 , ident :: Ident
49- , type_ :: Type
49+ , type_ :: PSType
5050 }
5151 | DeclValue
5252 { comments :: Maybe Comments
@@ -68,13 +68,13 @@ instance showDeclaration :: Show Declaration where show = genericShow
6868
6969type InstanceHead =
7070 { instName :: Ident
71- , instConstraints :: Array Constraint
71+ , instConstraints :: Array PSConstraint
7272 , instClass :: QualifiedName (ProperName ProperNameType_ClassName )
73- , instTypes :: NonEmptyArray Type
73+ , instTypes :: NonEmptyArray PSType
7474 }
7575
7676data Foreign
77- = ForeignValue { ident :: Ident , type_ :: Type }
77+ = ForeignValue { ident :: Ident , type_ :: PSType }
7878 | ForeignData { name :: ProperName ProperNameType_TypeName , kind_ :: Kind }
7979 | ForeignKind { name :: ProperName ProperNameType_KindName }
8080
@@ -98,31 +98,31 @@ derive instance eqFixityOp :: Eq FixityOp
9898derive instance ordFixityOp :: Ord FixityOp
9999instance showFixityOp :: Show FixityOp where show = genericShow
100100
101- data Type
101+ data PSType
102102 = TypeVar Ident
103103 | TypeConstructor (QualifiedName (ProperName ProperNameType_TypeName ))
104104 | TypeWildcard
105105 | TypeHole Ident
106106 | TypeString String
107- | TypeRow Row
108- | TypeRecord Row
109- | TypeApp Type Type
110- | TypeForall (NonEmptyArray TypeVarBinding ) Type
111- | TypeArr Type Type
112- | TypeKinded Type Kind
113- | TypeOp Type (QualifiedName (OpName OpNameType_TypeOpName )) Type -- like TypeArr, but with custom type alias
114- | TypeConstrained Constraint Type
107+ | TypeRow PSRow
108+ | TypeRecord PSRow
109+ | TypeApp PSType PSType
110+ | TypeForall (NonEmptyArray TypeVarBinding ) PSType
111+ | TypeArr PSType PSType
112+ | TypeKinded PSType Kind
113+ | TypeOp PSType (QualifiedName (OpName OpNameType_TypeOpName )) PSType -- like TypeArr, but with custom type alias
114+ | TypeConstrained PSConstraint PSType
115115 --
116116 -- no need to implement
117117 --
118118 -- | TypeOpName (QualifiedName (OpName OpNameType_TypeOpName))
119119 -- | TypeArrName
120- -- | TypeParens Type
120+ -- | TypeParens PSType
121121
122- derive instance genericType :: Generic Type _
123- derive instance eqType :: Eq Type
124- derive instance ordType :: Ord Type
125- instance showType :: Show Type where show x = genericShow x
122+ derive instance genericType :: Generic PSType _
123+ derive instance eqType :: Eq PSType
124+ derive instance ordType :: Ord PSType
125+ instance showType :: Show PSType where show x = genericShow x
126126
127127data Kind
128128 = KindName (QualifiedName (ProperName ProperNameType_KindName ))
@@ -157,7 +157,7 @@ instance showDataHead :: Show DataHead where show = genericShow
157157
158158newtype DataCtor = DataCtor
159159 { dataCtorName :: ProperName ProperNameType_ConstructorName
160- , dataCtorFields :: Array Type
160+ , dataCtorFields :: Array PSType
161161 }
162162
163163derive instance newtypeDataCtor :: Newtype DataCtor _
@@ -166,28 +166,28 @@ derive instance eqDataCtor :: Eq DataCtor
166166derive instance ordDataCtor :: Ord DataCtor
167167instance showDataCtor :: Show DataCtor where show = genericShow
168168
169- type Row =
170- { rowLabels :: Array { label :: Label , type_ :: Type }
171- , rowTail :: Maybe Type
169+ type PSRow =
170+ { rowLabels :: Array { label :: Label , type_ :: PSType }
171+ , rowTail :: Maybe PSType
172172 }
173173
174- newtype Constraint
175- = Constraint
174+ newtype PSConstraint
175+ = PSConstraint
176176 { className :: QualifiedName (ProperName ProperNameType_ClassName )
177- , args :: Array Type
177+ , args :: Array PSType
178178 }
179- -- | ConstraintParens Constraint
179+ -- | ConstraintParens PSConstraint
180180
181- derive instance genericConstraint :: Generic Constraint _
182- derive instance eqConstraint :: Eq Constraint
183- derive instance ordConstraint :: Ord Constraint
184- instance showConstraint :: Show Constraint where show = genericShow
181+ derive instance genericConstraint :: Generic PSConstraint _
182+ derive instance eqConstraint :: Eq PSConstraint
183+ derive instance ordConstraint :: Ord PSConstraint
184+ instance showConstraint :: Show PSConstraint where show = genericShow
185185
186186-- Delimeted or separated
187187type ClassHead =
188188 { name :: ProperName ProperNameType_ClassName
189189 , vars :: Array TypeVarBinding
190- , super :: Array Constraint
190+ , super :: Array PSConstraint
191191 , fundeps :: Array ClassFundep
192192 }
193193
@@ -208,7 +208,7 @@ data Binder
208208 | BinderNumber (Either Int Number )
209209 | BinderArray (Array Binder )
210210 | BinderRecord (Array (RecordLabeled Binder ))
211- | BinderTyped Binder Type
211+ | BinderTyped Binder PSType
212212 | BinderOp Binder (QualifiedName (OpName OpNameType_ValueOpName )) Binder
213213 -- | BinderParens Binder -- no need
214214
@@ -232,7 +232,7 @@ type Where =
232232 }
233233
234234data LetBinding
235- = LetBindingSignature { ident :: Ident , type_ :: Type }
235+ = LetBindingSignature { ident :: Ident , type_ :: PSType }
236236 | LetBindingName ValueBindingFields
237237 | LetBindingPattern { binder :: Binder , where_ :: Where }
238238
@@ -262,7 +262,7 @@ data Expr
262262 | ExprNumber (Either Int Number )
263263 | ExprArray (Array Expr )
264264 | ExprRecord (Array (RecordLabeled Expr ))
265- | ExprTyped Expr Type
265+ | ExprTyped Expr PSType
266266 | ExprInfix Expr Expr Expr -- e.g. `1 : 2 : Nil`
267267 | ExprOp Expr (QualifiedName (OpName OpNameType_ValueOpName )) Expr
268268 | ExprOpName (QualifiedName (OpName OpNameType_ValueOpName ))
@@ -334,7 +334,7 @@ type AdoBlock =
334334 }
335335
336336data InstanceBinding
337- = InstanceBindingSignature { ident :: Ident , type_ :: Type }
337+ = InstanceBindingSignature { ident :: Ident , type_ :: PSType }
338338 | InstanceBindingName ValueBindingFields
339339
340340derive instance genericInstanceBinding :: Generic InstanceBinding _
0 commit comments