[clean-list] understanding list type definition
Arjen van Weelden
A.vanWeelden at cs.ru.nl
Wed Oct 4 11:17:53 MEST 2006
Yes, [Int Bool] is legal _syntax_. However, it will not type check
because Int Bool is not a legal _type_. The part of the language report
that you quoted below is only a syntax description for types, not a
specification of Clean's type checker.
kind regards,
Arjen
Jigang Sun wrote:
> On language report 2.0, page 115,
>
> ListType = [[ListKind] Type [SpineStrictness]]
> Type = {BrackType}+
> BrackType = [UniversalQuantVariables] [Strict] [UnqTypeAttrib] TypeExpression
>
> Type Expression = TypeVariable // see A.7
> |typeConstructorName
> | (Type)
> | PredefinedType
> | PredefinedTypeConstructor
>
> PredefinedType = BasicType
> | ListType
> | TupleType
> | ArrayType
> | ArrowType
> | PredefType
>
> BasicType = Int
> | Real
> | Char
> | Bool
>
> so a list type [Int Bool] is legal?
>
> Jigang
>
>
> _______________________________________________
> clean-list mailing list
> clean-list at science.ru.nl
> http://mailman.science.ru.nl/mailman/listinfo/clean-list
More information about the clean-list
mailing list