[clean-list] uniqueness attribute derivation/specification inconsistency

John van Groningen johnvg at cs.ru.nl
Tue Nov 20 15:23:07 MET 2007


TK <0000tk at gmail.com> wrote:
>For example
>
>labelControl name control =
>	LayoutControl
>		(	TextControl name []
>		:+:	control
>		)
>		[ ControlHMargin 1 1 , ControlVMargin 1 1 , ControlItemSpace 0 0 ]
>
>Compiler derives
>
>labelControl :: {#.Char} (a .b .c) -> (LayoutControl (:+: .TextControl
>.a) .b .c)
>
>which when specified, gives
>
>Error [GUI.icl,_,labelControl]: a inconsistently attributed (5)

This is caused by the incorrect type definitions in
StdIOBasic.dcl and StdIOBasic.icl:

:: :~: t1 t2 cs    = (:~:) infixr 9 .(t1 cs) .(t2 cs)

:: :+: t1 t2 ls cs = (:+:) infixr 9 .(t1 ls cs) .(t2 ls cs)

The . before (t1 and (t2 is not allowed, because all occurrences of
type varables should have the same uniqueness attribute.

The types should be changed to:

:: :~: t1 t2 cs    = (:~:) infixr 9 (t1 cs) (t2 cs)

:: :+: t1 t2 ls cs = (:+:) infixr 9 (t1 ls cs) (t2 ls cs)

All the libraries and programs in the Clean 2.2 distribution can
be compiled without changes after this modification.

The compiler did not detect the error in the type definitions,
and other type definitions in which a . is used before a type
variable used as a type constructor variable. This has been fixed.

Kind regards,

John van Groningen



More information about the clean-list mailing list