[Haskell-beginners] Overlapping instances
Nathan Hüsken
nathan.huesken at posteo.de
Tue Dec 25 17:46:15 CET 2012
On 12/25/2012 05:05 PM, Brandon Allbery wrote:
> On Tue, Dec 25, 2012 at 10:52 AM, Nathan Hüsken
> <nathan.huesken at posteo.de <mailto:nathan.huesken at posteo.de>> wrote:
>
> instance B b => A b where
> doSomething = doMore
>
>
> This doesn't quite do what you think; it matches *all* types, then
> afterward applies the context.
>
> Your terminology suggests you're trying to do OOP with typeclasses.
> Don't; they're not OOP, and treating them like they are leads only to
> grief.
Well, you are completely right. The reason is, that I am trying to write
FFI for a OOP library.
More information about the Beginners
mailing list