[clean-list] FunctionType question

Jigang Sun Jigang.Sun at student.paisley.ac.uk
Thu Jan 18 13:44:37 MET 2007


I have a simple Start module

module try		
sub :: Int Int -> Int Int 
sub x y = x 3

Start =  (sub)  12 23

When I try to run it--
Parse error [try.icl,2;23,Type]: ordinary type variable expected

If I change it to--
module try
sub :: Int Int ->(Int Int) 
sub x y =( x 3 )

Start =  (sub)  12 23

When I tried to run it, 
Parse error [try.icl,2;23,Type]: ordinary type variable expected

According to the following grammar, "Int Int" is correct Type syntax, "(Int Int)" is Type Expression syntax, hence a Type.
 
FunctionType = [Type -> ] Type [ClassContext] [UnqTypeUnEqualities]

Type = {BrackType}+
BrackType = [UniversalQuantVariables] [Strict] [UnqTypeAttrib] TypeExpression

Type Expression = TypeVariable // see A.7
| (Type)
| PredefinedType
...

PredefinedType = BasicType
| ListType
...

BasicType = Int
| Real
| Char

Many thanks.
Jigang





Legal disclaimer
--------------------------

The information transmitted is the property of the University of Paisley and is intended only for the person or entity 
to which it is addressed and may contain confidential and/or privileged material.  Statements and opinions expressed in this e-mail may not represent those of the company.  Any review, retransmission, dissemination and other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
If you received this in error, please contact the sender immediately and delete the material from any computer. 

--------------------------




More information about the clean-list mailing list