[clean-list] observers in your plans?
Carlos Aya
carlosayam at yahoo.com.au
Fri Nov 27 10:53:42 MET 2009
Dear Clean Team,
Just curious if you have among the plans, implementation of so-called observer types, i.e. variables that do not add as counting occurences.
The problem with the following function ...
doIt :: *(a e) (Int -> e) -> *(a e) | Array a e
doIt arr f = {arr & [i] = f i \\ i <- [0.. (size arr)]}
... is that (size arr) counts as occurrence in the body of doIt, so arr cannot be unique. But as seen in the _SystemArray implementation, size only reads the size of the array which we know is fixed. So, truly its signature should be
size :: 0:arr -> Int
(I put 0: to indicate an "observed" parameter, out of my ignorance.. and based on Odersky paper...)
So, although doIt as idea doesn't conflict with update-in-place, it cannot be implemented in Clean.
What do you think?
Kind regards
Carlos
__________________________________________________________________________________
Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7.
Enter now: http://au.docs.yahoo.com/homepageset/
More information about the clean-list
mailing list