Propsal: NoDatatypeContexts
John Meacham
john at repetae.net
Mon Jul 19 17:31:01 EDT 2010
On Mon, Jul 19, 2010 at 11:29:37AM +0200, Christian Maeder wrote:
> I'm for this proposal, although I've got an example where I need this
> context, namely for DrIFT to derive a proper context for instances.
>
> DrIFT doesn't know that the Read instance for Data.Set.Set relies on Ord
> of the elements. For
>
> data Ord symbol => ExtSign sign symbol = ExtSign
> { plainSign :: sign
> , nonImportedSymbols :: Set.Set symbol
> } deriving Show
>
> DrIFT cannot derive the Read (or our deserialization) instance without
> the "Ord symbol =>" context.
>
> However, ghc is able by "deriving (Show, Read)" to see
>
> instance (Ord symbol, Read sign, Read symbol) =>
> Read (ExtSign sign symbol)
>
> without the context.
Hmm... if you can provide a fix for this I'll integrate it, perhaps a
manual annotation will be the only way, I don't think there is any easy
way for DrIFT to derive that information otherwise.
John
--
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
More information about the Haskell-prime
mailing list