Steve Downey wrote:
interesting. it leads to something that feels much more like an object based, as opposed to a class based, system. as far as haskell is concerned, everything has the same type, even though different instances have very different behavior. .... the question is, which plays nicer with the rest of haskell? that is, if i'm not committing to a closed dsl, which style is more likely to be reusable against other libraries.
I suspect there's no right answer - it's a case of choosing the best approach for the problem. As an example, my charting library (http://dockerz.net/software/chart.html) uses the record of functions approach for composing drawings: data Renderable = Renderable { minsize :: (Render RectSize) render :: (Rect -> Render ()) } Tim