Some questions on Clean

awollschlaeger@apriori.de awollschlaeger@apriori.de
Wed, 02 Oct 96 00:20:11 -0400


Hello alltogether,
I have some questions on Clean, 'hope you can add light:

1. Is there any documentation about the use of the "ccall"
   construct? I'd like to add some missing functions to the
   Clean Library (Network Sockets etc.).

2. How do I observe an unique State? The following piece of code
   shows the problem:

<SNIP>
module foo;

import StdEnv;

:: *S :== (Int, Int);

getA :: *S -> Int;
getA (a,_) = a;

setA :: Int *S -> *S;
setA x (_,b) = (x,b);

doubleA :: *S -> *S;

// this works:

// doubleA (a,b) = (a+a,b);

// this wont compile:

doubleA s = s` where
{
  a = getA s;
  s` = setA (a+a) s
};

Start = doubleA (5,5);

</SNIP>

When I try to observe an unique State with a function like getA, the
compiler moans about "conflicting uniqueness information".  The
uncommented variant of "doubleA" works. What am i doing wrong?

Cheerio,
Andreas 


-- 
-----------------------------------------------------------
In reality:                     In virtuality:
 Andreas Wollschlaeger           awo@wiwi.uni-frankfurt.de
 Odrellstr. 78                   awollschlaeger@apriori.de
 60486 Frankfurt/M.
 Germany
-----------------------------------------------------------