On 3/10/08, John Meacham
what actually happens in the compiler is:
a class definition
module Main where class Foo a where foo :: a -> Int
produces the following bit of core (written in psuedo-haskell)
{-# NOINLINE foo #-} Main.foo :: forall a . a -> Int Main.foo = error "Placeholder"
as far as everything else is concerned, this is just another routine like any other, since it is never inlined, the fact that its body is 'error' is never exposed.
an instance
instance Foo Char where foo c = ord c
produces the following core
Instance@.Main.Foo.foo.Prelude.Char :: Char -> Int Instance@.Main.Foo.foo.Prelude.Char c = ord c
{-# RULES "foo/char/instance" Main.foo Char = Instance@.Main.Foo.foo.Prelude.Char #-}
Hmm. What should I name default implementations?