[Haskell-cafe] What's the deal with Clean?
leimy2k at gmail.com
Wed Nov 4 10:27:26 EST 2009
On Wed, Nov 4, 2009 at 7:11 AM, Edsko de Vries <edskodevries at gmail.com>wrote:
> On 4 Nov 2009, at 13:36, Alberto G. Corona wrote:
>> I know what uniqueness means. What I meant is that the context in which
>> uniqueness is used, for imperative sequences:
>> (y, s')= proc1 s x
>> (z, s'')= proc2 s' y
>> is essentially the same sequence as if we rewrite an state monad to make
>> the state explicit. When the state is the "world" state, then it is similar
>> to the IO monad.
> Yes, as long as there is a single thing that is being updated there's
> little difference between the state monad and a unique type. But uniqueness
> typing is more general. For instance, a function which updates two arrays
> f (arr1, arr2) = (update arr1 0 'x', update arr2 0 'y')
> is easily written in functional style in Clean, whereas in Haskell we need
> to sequentialize the two updates:
> f (arr1, arr2)
> = do writeArray arr1 0 'x'
> writeArray arr2 0 'y'
Those sequential updates can be run concurrently on both, just with
different syntax though right?
> You can find a more detailed comparison in my thesis (
> Section 2.8.7).
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe