[Haskell-cafe] Re: Type question in instance of a class

J. Garrett Morris jgmorris at cecs.pdx.edu
Tue Nov 18 13:08:42 EST 2008


On Tue, Nov 18, 2008 at 1:38 AM, Reiner Pope <reiner.pope at gmail.com> wrote:
> ATs are "Associated Types", aka Type Families. They can be found in
> the GHC 6.10 manual here:
> http://haskell.org/ghc/docs/6.10.1/html/users_guide/type-families.html
>
> As a starting point, you might want to try something like:
>
> class Complex c where
>   type RealType c
>   realPart :: c -> RealType c
>   imagPart :: c -> RealType c

I imagine that the generalized newtype deriving might be trickier to
get working for this formulation.

 /g

-- 
I am in here


More information about the Haskell-Cafe mailing list