
10 Aug
2007
10 Aug
'07
1:45 a.m.
{-# OPTIONS -fglasgow-exts #-} -- G'day everyone. -- This is okay. f1 :: (?foo :: String) => String f1 = ?foo -- So is this. f2 :: (Show a, ?foo :: a) => a -> String f2 _ = show ?foo -- Hugs allows this. GHC rejects it on the grounds that "a" is unused -- on the right-hand side of the (=>). I think this is arguably a bug -- in GHC. f3 :: (Show a, ?foo :: a) => String f3 = show ?foo -- GHC rejects this. Hugs compiles it, but I can't call it as -- let ?foo = "Hello" in show Foo -- -- Is there a good reason to disallow this? data Foo = Foo instance (?foo :: String) => Show Foo where showsPrec _ Foo = showString ?foo . showString "Foo" -- Cheers, -- Andrew Bromage