RE: [Haskell-cafe] Typeclasses and implicit parameters

2007-09-06 Thread Simon Peyton-Jones
| -- 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 Hugs is right here. GHC 6.8 accepts this too, and has done for some time; there's

RE: [Haskell-cafe] Typeclasses and implicit parameters

2007-09-06 Thread ajb
G'day all. Quoting Simon Peyton-Jones <[EMAIL PROTECTED]>: | -- 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 _ F

Re: [Haskell-cafe] Typeclasses and implicit parameters

2007-09-06 Thread Stefan O'Rear
On Thu, Sep 06, 2007 at 06:49:21AM -0400, [EMAIL PROTECTED] wrote: > For completeness, here's the final solution, courtesy of int-e (whose > real name I don't know; sorry), which is much more elegant than I Bertram Felgenhauer > bindString :: (forall s. StringAsType s => Mark s a) -> String -> a