Re: Types of generated data constructors for dictionaries

2008-09-02 Thread pepe
Solved, thanks for your help Simon. I was assuming that dataConRepType would return a core type, i.e. with the predicates translated to actual dictionaries. With that assumption out of the way, everything fits in its place. pepe On 28/08/2008, at 15:50, Simon Peyton-Jones wrote: > class E

RE: Types of generated data constructors for dictionaries

2008-08-28 Thread Simon Peyton-Jones
> class Eq a => Eq2 a where eq :: a -> a -> Bool Based on the runtime representation above, I expect the type of Main.:DEq2 to be Main.:DEq2 :: GHC.Base.:TEq a -> (a -> a -> Bool) -> Main.:TEq2 a but GHC tells me, via (fmap dataConRepType . tcLookupDatacon), the following Main.:DEq2 :: (a ->

Re: Types of generated data constructors for dictionaries

2008-08-26 Thread pepe
On 26/08/2008, at 13:30, Simon Peyton-Jones wrote: | E.g., the type below is generated for :DNum, the datacon of a Num | dictionary. | At least, this is what :print obtains from a tcLookupDatacon on :DNum. | | :DNum ::(a -> a -> a) | -> (a -> a -> a) |

RE: Types of generated data constructors for dictionaries

2008-08-26 Thread Simon Peyton-Jones
| E.g., the type below is generated for :DNum, the datacon of a Num | dictionary. | At least, this is what :print obtains from a tcLookupDatacon on :DNum. | | :DNum ::(a -> a -> a) | -> (a -> a -> a) | -> (a -> a -> a) |