[Haskell-cafe] Re: problem with collection (container) class

Ben Franksen ben.franksen at online.de
Fri Feb 8 16:14:45 EST 2008


Daniel Fischer wrote:
> {-# LANGUAGE MultiParamTypeClasses #-}
> {-# LANGUAGE FunctionalDependencies #-}
> {- # LANGUAGE FlexibleInstances # -}
> module Leandro where
> 
> data Abb a b = Branch a b (Abb a b) (Abb a b) | Leaf
> 
> data ListAssoc a b = Node a b (ListAssoc a b) | Empty
> 
> class Container c a b |c -> a, c -> b where
>     [...]
> 
> instance (Ord a) => Container (Abb a b) a b where
>     [...]
> 
> Note: The FlexibleInstances Language pragma is required by GHC 6.8.1 and
> 6.8.2, but not by GHC 6.6.1 or hugs, I think that's a bug in 6.8.*

If it's a bug then it is probably in 6.6.1 too, it just gets hidden by the
fact that in 6.6.1 the -fglasgow-exts extensions cannot be activated
separately. If you enable one of them, you get them all.

Cheers
Ben



More information about the Haskell-Cafe mailing list