+
+-- dataConRepType returns the type of the representation of a contructor
+-- This may differ from the type of the contructor Id itself for two reasons:
+-- a) the constructor Id may be overloaded, but the dictionary isn't stored
+-- b) the constructor may store an unboxed version of a strict field.
+-- Here's an example illustrating both:
+-- data Ord a => T a = MkT Int! a
+-- Here
+-- T :: Ord a => Int -> a -> T a
+-- but the rep type is
+-- Trep :: Int# -> a -> T a
+-- Actually, the unboxed part isn't implemented yet!
+
+dataConRepType :: GenId (GenType tv u) -> GenType tv u
+dataConRepType con
+ = mkForAllTys tyvars tau
+ where
+ (tyvars, theta, tau) = splitSigmaTy (idType con)
+