[Haskell-cafe] unsafeDestructiveAssign?
Bulat Ziganshin
bulat.ziganshin at gmail.com
Tue Aug 11 12:23:53 EDT 2009
Hello Job,
Tuesday, August 11, 2009, 7:48:45 PM, you wrote:
> I'm also looking for a way to make actual copies of data.
> so I could do something like this:
i think you are just going non-FP way. haskell is great for declaring
algorithms in pure mathematical way - as a function projecting input
values into results. "updating" is just word from another world
just for example - little function that joins two ordered lists
returning list-in-order. note that it doesn't describe any updates, it
describes how to build result from input values:
merge xs [] = xs
merge [] ys = ys
merge (x:xs) (y:ys) | x<y = x : merge xs (y:ys)
| otherwise = y : merge (x:xs) ys
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Haskell-Cafe
mailing list