does this irritate anyone else?

Mike T. Machenry dskippy@ccs.neu.edu
Wed, 26 Feb 2003 11:41:22 -0500


I am trying to use type classes to get some percollate actions through a
nested data structure. The problem is I can't make an instance of a class
unless the type is defined with newtype or data. This means all of my
functions look something like this:

findFugitive :: DetectiveLocations -> FugitiveLocations -> Move -> FugitiveLocat
findFugitive (DetectiveLocations dL) (FugitiveLocations fL) StartGame =
  (FugitiveLocations minusSet fL (occupiedStops dL))

instead of this:

findFugitive :: DetectiveLocations -> FugitiveLocations -> Move -> FugitiveLocat
findFugitive dL fL StartGame = minusSet fL (occupiedStops dL)

which is much simpler to read. Why can't I make a normal type an instance of 
a type class? I get errors that it's an ambiguous type.

thanks,
-mike