Several default implementations for instance methods

2014-10-04 Thread Andreas Abel
Consider the following class for an overloaded pretty printer. For atomic data (numeric types, String etc.) one would implement prettyShow, for complex data either pretty or prettyPrec. import Text.PrettyPrint class Pretty a where pretty :: a - Doc prettyShow :: a - String

Re: [Haskell-cafe] Several default implementations for instance methods

2014-10-04 Thread Carter Schonwald
hrm, so youre wanting something even smarter than the MINIMAL pragma stuff, namely depending on which subset of the complementary methods are defined, define this method differently? On Sat, Oct 4, 2014 at 11:44 AM, Andreas Abel ab...@chalmers.se wrote: Consider the following class for an

Re: [Haskell-cafe] Several default implementations for instance methods

2014-10-04 Thread Brandon Allbery
On Sat, Oct 4, 2014 at 12:05 PM, Carter Schonwald carter.schonw...@gmail.com wrote: hrm, so youre wanting something even smarter than the MINIMAL pragma stuff, namely depending on which subset of the complementary methods are defined, define this method differently? I've been expecting