Re: type classes vs. multiple data constructors

2003-02-17 Thread Andrew J Bromage
G'day. On Mon, Feb 17, 2003 at 01:44:07AM -0500, Mike T. Machenry wrote: > I was wondering if it's better to define them as type classes with the > operations defined in the class. What do haskellian's do? I can't speak for other Haskellians, but on the whole, it depends. Here's the common sit

type classes vs. multiple data constructors

2003-02-16 Thread Mike T. Machenry
I have a type that is as follows: data PlayerState = FugitiveState { tickets :: Array Ticket Int, fHistory :: [Ticket] } | DetectiveState { tickets :: Array Ticket Int, dHistory :: [Stop] } I have a few functions that act on PlayerState. move :: PlayerState ->