minh thu wrote:
> to be clear, the data structure i'm thinking of is the "half edge" or
> "winged edge"

this would involve a cyclic structure, and you want to update that.  I
don't think there's a purely functional way to implement that, and if
there is, it wouldn't allow O(1) modifications.

So it appears, you will have to mangle pointers.  This is indeed
possible, pointers in Haskell are spelled "STRef".


> the idea of creating the data structure in plain c (and maybe the
> basic functions) and then use it (them) in haskell is bad ?

Do you honestly think that C is ever a good idea?  Of course, you can
write the data structure in C, but it will be essentially the same code
you would write in Haskell using STRefs.  Additionally you will get the
usual off-by-one errors, dangling pointers and the ever helpful error
message "killed by SEGSEGV".


Udo.
-- 
<Alanna> Saying that Java is nice because it works on all OS's is 
like saying that anal sex is nice because it works on all genders.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to