[Haskell] Classes with no data type
tatd2 at kent.ac.uk
Mon Oct 9 19:23:32 EDT 2006
I've met an interesting problem in terms of how to type a data
structure and the functions that operate upon it.
The problem centres around a single data type. This data type can be
constructed in multiple ways using different functions, depending on
the options the user specifies. That's all simple enough. The
problem really comes later on. Depending on the function used
generate the data structure I want to use different functions later
on for example, to display the data.
Thus I have a typical classes problem, in that I have several
implementations of essentially the same function for different
circumstances. The problem is, they must all operate on the same
data type, so I cannot define them as seperate instances.
Anyone got any ideas how to type this?
More information about the Haskell