[Haskell-cafe] Closed Classes

Carlos Camarão camarao at dcc.ufmg.br
Thu Aug 12 22:08:39 EDT 2004

> Notwithstanding module Y, I don't think you should infer in module X
> that g::Int (or, rather, Int->Int).

Oops, I meant Int->Int.

> Since f is defined in a type class, it should be polymorphic, and so
> should g.  When you apply g to [an expression of a given] type, it
> will check to see what instances are available, and match only if
> Int is the type of the variable.  But there's no reason to restrict
> the type of g itself.

Sorry I wasn't clear: I meant to be talking about (an approach for)
"closed classes".

More information about the Haskell-Cafe mailing list