[clean-list] A bug?

Arjen A.vanWeelden at cs.ru.nl
Wed Feb 14 11:54:44 MET 2007


You are partly right. (+) 3 has type Int -> Int, therefore Start has 
type (Int -> Int). But this is neither a bug, nor a problem. Start is an 
expression (or function without arguments) that yields a function (of 
type Int -> Int). When evaluated, this is printed by the Clean run-time 
system as the partial application of (+) to 3.

The arity of a function is expressed in the type of a function in Clean.
Start :: (Int -> Int) is, in Clean, different from Start :: Int -> Int.
The second one says that Start a function that takes one argument (an 
Int) and returns an Int. The first says that Start is a function without 
arguments that returns a function (from Int tot Int).

kind regards,
	Arjen

Jigang Sun wrote:
> The start module:
> 
> module try
> import StdEnv
> Start=  ( + ) 3
> 
> 
> result:
> (+;6 3)
> 
> I think type of + should be Int Int -> Int, so (+) 3 should be Int -> Int.  
> 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. 
> 
> --------------------------
> 
> 
> _______________________________________________
> 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