I wrote:
If, furthermore, the "confusing instance" is commented out, the source even compiles without extensions.

Correction: -fglasgow-exts is still required for the type GeneralBreakFn, but -fallow-overlapping-instances can be omitted.


{-# OPTIONS -fglasgow-exts -fallow-overlapping-instances 
-fallow-undecidable-instances -fallow-incoherent-instances #-}
module InCoherentInst where

import Control.Exception(throwDyn)

import Data.Typeable(Typeable)

class Confuse a where
    confuse :: a -> String

instance Confuse a => Typeable a

data GeneralBreakFn a = GeneralBreakFn (forall b . a -> b)

addGeneralFallOut :: Typeable a => GeneralBreakFn a
addGeneralFallOut =
      let breakFn a = throwDyn (GeneralFallOutExcep a)
      in GeneralBreakFn breakFn

data GeneralFallOutExcep a = GeneralFallOutExcep a deriving (Typeable)
_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to