- -- It is vital for newtype reconstruction that the unification step is done
- -- right here, _before_ the subterms are RTTI reconstructed.
- let myType = mkFunTys subTtypes tv
- fst `fmap` instScheme(dataConRepType dc) >>= addConstraint myType
- return $map (\(I# i#,t) -> case ptrs clos of
- (Array _ _ ptrs#) -> case indexArray# ptrs# i# of
- (# e #) -> (t,e))
+ -- It is vital for newtype reconstruction that the unification step
+ -- is done right here, _before_ the subterms are RTTI reconstructed
+ let myType = mkFunTys subTtypes tv
+ (signatureType,_) <- instScheme(dataConRepType dc)
+ addConstraint myType signatureType
+ return $ map (\(I# i#,t) -> case ptrs clos of
+ (Array _ _ ptrs#) -> case indexArray# ptrs# i# of
+ (# e #) -> (t,e))