[clean-list] Re: Clean compiler exited abnormally

G.W.M. Vissers vissers@theochem.kun.nl
Thu, 13 Sep 2001 15:39:39 +0200 (CEST)


Hello Siegfried (and the rest of this list),

To start with the main point: I tried the changes you proposed, but
without succes. The compiler still fails at the same point.

Secondly, I'm a bit in the dark with what it exactly is that we tried to
do here. If I recall correctly the change consists of two things: the
elements in the inner arrays are unboxed ( {#t} ), and these inner arrays
are made unique by using the *. Two things spring to my mind then. The
first is that we have not actually provided any additional strictness
information (please correct me if I'm wrong), the second is that I would
suppose that by making the inner arrays unique, that the outer array would
also becomes unique (again: correct me if I'm wrong).

So I tried to actually provide as much strictness information as I could,
by making the array strict:

str1d :: !{! t} -> String | ArrayElem, toString t
str2d :: !{!{! t}} -> String | ArrayElem, toString t

and keeping the rest of the code as it was. Well, you can guess the result
by now ... :(

The second point I tested, by using the definitions you gave for the
functions, and changing the main program to

Start
# str = str2d mat
| str == "" = ""
= str
where
  mat = {{1,2,3},{3,4,5},{6,7,8}}

which indeed gives a type error:

Type error [bla.icl,6,Start]: "argument 1 of str2d" * attribute required
but not offered at the indicated position: ^ {{#Int}}

> Try it with strictness information:
>
> But then you may not use the size-function in your function; but you can
> pass the size (for the test case only) directly or use it this way:
>
>
> str1d :: {#t} -> String | ArrayElem, toString t
> str1d x = str1d` 0
> where
>   //n = size x
>   str1d` i
>   | i == (size x) = ""
>   = toString x.[i] +++ " " +++ str1d` (inc i)
>
> str2d :: {*{#t}} -> String | ArrayElem, toString t
> str2d xx = str2d` 0
> where
>   //n = size xx
>   str2d` i
>   | i == (size xx) = ""
>   = str1d xx.[i] +++ "\n" +++ str2d` (inc i)
>
> Start = str2d {{1,2,3},{3,4,5},{5,6,7}}
>
>
> Notice: str1d will not accept: *{#} only str2d accepts unique
> information!
>
>
> Please report what will happen now.
>
> S. Gonzi
>