[Haskell-beginners] How to get qualifiers into type

Rustom Mody rustompmody at gmail.com
Thu Jan 17 14:40:48 CET 2013


I am playing around with some small graph theory problems.
[Yeah I know there are good libraries -- as I said just playing around...]

And I need to do things like

type Vertex = Ix a => a
(so that a vertex can be used to index an adjacency-list-array)

That is to say that whenever 'Vertex' appears in a type signature, the Ix
should 'float' out to the qualifier list
After a lot of nudging from the error messages  and rewriting as

type Vertex = forall a. Ix a => a
and giving options
 LANGUAGE RankNTypes, ImpredicativeTypes, LiberalTypeSynonyms

I still get all kinds of errors.  I'll report them if required. However
first of all would like to know: Is this the way to go? Is this possible?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130117/23bc2ba8/attachment.htm>


More information about the Beginners mailing list