Hi Peter,

Sorry for the previous, incomplete reply. 
Eudora thinks that Ctrl-E should mean: Send immediatEly instead of
End-of-line...

>class ResourcePool p where
>    newp :: p -> e -> p -- adds new element e to the resource pool p

If you want to add the element of type e to the pool, the type of
the pool should incorporate this type. Therefore, it should be
"p e" for example.

  newp :: poolOf elem -> elem -> poolOf elem

>As one instance of this class, I want a resource pool where the type "e"
>becomes a pair consisting of an Id and a value (x), as follows:
>
>data Pool id x = EmptyPool | NewPool id x

I do not completely understand what you want to make.
I would expect something like:

  data Pool elem = EmptyPool | NewPool elem (Pool elem)

and then:

  instance ResourcePool Pool where
    newp p elem = NewPool elem p

>On the subject of multi-parameter classes, the hugs system does not
>seem to permit them. Is the story different on GHC?

Hugs 1.3c does, but I don't know whether you need them
for your problem. Anyway, it can be downloaded at:

  http://www.cs.nott.ac.uk/~mpj/hugs13/

Bye,
  Arjan



Reply via email to