Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Haskell object system

Name: Anonymous 2012-02-12 0:54

Hey /prog/. I'm trying to implement a simple object system in Haskell - nothing too complicated, an object is just an ID and a list of properties - and I'm stuck on how to implement the properties efficiently. The obvious method would be a Map String Value, but I don't want to have to compare a bunch of strings each time I access an object's properties.

The other way I can think of doing it would be data Property = Prop1 | Prop2 | ..., but I don't want to have to explicitly list every property I might want to use. They probably won't even be known at compile-time. Also, I don't want to use Ints because that's not very readable.

Is there some datatype that would make more sense to use? Or is there a completely different way that I should be doing this?

Thanks.

Name: Anonymous 2012-02-12 1:48

use javascript

Name: Anonymous 2012-02-12 6:52

Haskell is Jewish and not capable of doing anything useful.

Don't change these.
Name: Email:
Entire Thread Thread List