Hi Ferreira,

The error is caused by the type of func:

func :: *Int -> Int

The asterisk (*) at the Int argument of func states that you demand a so-called unique Integer value whenever you call func. You really do not need to use these kind of annotations when you are a beginner at programming in Clean. Simply remove the asterisk from your program, like so:

func :: Int -> Int

will remove the type error.

Kind regards,
Peter



On 2/17/2016 3:40 PM, Ferreira Maurizio wrote:

I cannot understand this error  in the following program

Uniqueness error [test.icl,9,Start]:"argument 1 of func" attribute at position indicated by ^ could not be coerced ^ Int

module test

import StdEnv

func :: *Int -> Int

func x = x + 1

z = 1 + 1

Start = func z

the error disappears if I define

z = 1

It seems to me that  z is used only once.

(I’m just a beginner at functional programming)

Any suggestion ?

Best regards.

Maurizio.



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

Il presente messaggio, corredato dei relativi allegati, contiene informazioni da considerarsi strettamente riservate ed è destinato esclusivamente al destinatario sopra indicato, il quale è l'unico autorizzato ad usarlo, copiarlo e, sotto la propria responsabilità, diffonderlo. Chiunque ricevesse questo messaggio per errore o comunque lo leggesse senza esserne legittimato è avvertito che trattenerlo, copiarlo, divulgarlo, distribuirlo a persone diverse dal destinatario è severamente proibito, ed è pregato di rinviarlo immediatamente al mittente distruggendone l'originale.


This message, together with its annex(es), contains information to be deemed strictly confidential and is destined only to the addressee(s) identified above who only may use, copy and, under his/their responsibility, further disseminate it. If anyone received this message by mistake or reads it without entitlement is forewarned that keeping, copying, disseminating or distributing this message to persons other than the addressee(s) is strictly forbidden and is asked to transmit it immediately to the sender and to erase the original message received.



_______________________________________________
clean-list mailing list
[email protected]
http://mailman.science.ru.nl/mailman/listinfo/clean-list

_______________________________________________
clean-list mailing list
[email protected]
http://mailman.science.ru.nl/mailman/listinfo/clean-list

Reply via email to