[Haskell-cafe] Re: Fun with multi-parameter type classes

Sam Mason mason at f2s.com
Sat Aug 21 21:06:32 EDT 2004


karczma wrote:
>Actually, I would like to know what was the purpose of all
>that... 

I was writing some new code and wanted to break it into two parts,
they should have very little knowledge of each other other than what
methods are available in each (hence the classes).  The actual types
of the values that were being passed around should have remained
invisible to the other half of the code.

Anyway, I didn't want to dump loads of code on you so I rewrote it in
a simpler manner that took the form of the "read" and "show".  The
actual implementations weren't supposed to be of importance, just the
fact that they were passing around something that the calling code
shouldn't have known about.

I've since realised that I can't solve the problem in the way I
originally wanted to and have now sort of turned the code inside out
so that there aren't any magically typed references floating around.

Hope that makes a bit more sense now,
  Sam


More information about the Haskell-Cafe mailing list