[Shootout-list] Dispatch benchmark questions

Einar Karttunen ekarttun@cs.helsinki.fi
Wed, 06 Jul 2005 10:47:42 +0300


Hello

I just want to make some questions on the new dispatch benchmark mainly
on what is required and what not. 

Would the following be legal:

* BottleStates are immutable - thus making a flyweight pattern make
  little sense. What does flyweight pattern mean in a language that does
  not have pointer equality?

data BottleState a = Full | Empty | Sealed | Subclass a
data PBottleState  = UPFull | UPEmpty | PUnsealed | PSealed
type BS = BottleState PBottleState


* "PressurizedBottle is a subclass of Bottle"

But they have equal contents (a PressurizedBottle is a Bottle and adds
no new members). Is using types like the following cheating?

type Bottle  = IORef BS
type PBottle = IORef PBottleState -- (or BS if so required)

newBottle  = newIORef Full
newPBottle = newIORef UPFull


- Einar Karttunen