
17 Jan
2013
17 Jan
'13
9:53 a.m.
Hi Rustom, On Thu, Jan 17, 2013 at 07:10:48PM +0530, Rustom Mody wrote:
type Vertex = Ix a => a (so that a vertex can be used to index an adjacency-list-array)
Ix is a type class, so you can only create an instance for an existing type, but not "rename" the type class to something else.
That is to say that whenever 'Vertex' appears in a type signature, the Ix should 'float' out to the qualifier list
You add the constraint to the functions using the index: element :: Ix a => a -> ListArray b -> b element index array = ... Greetings, Daniel