
On Thu, Apr 30, 2009 at 07:40:16PM +0200, Daniel Fischer wrote:
You can ask GHC by compiling the module without the type signature and with the flag -ddump-simpl , the relevant part of the core is:
==================================================================
Nonsense.nonsense :: forall t_agD s_agJ. (Nonsense.SUBST s_agJ) => t_agD -> Data.Maybe.Maybe s_agJ [GlobalId] [Arity 2] Nonsense.nonsense = \ (@ t_agD) -- type of argument (@ s_agJ) -- type of result is (Maybe s_agJ) ($dSUBST_agL :: Nonsense.SUBST s_agJ) -- SUBST dictionary for s_agJ (eta_shh :: t_agD) -> letrec { nonsense1_agA :: t_agD -> Data.Maybe.Maybe s_agJ -- inner nonsense, the type is fixed as that at which the outer nonsense is called, -- there is *no* forall here! [Arity 1]
Thanks for you detailed explanation. Finally it makes sense ;-) It seems to me that type inference without the type signature added an explicit type annotation itself. So when GHCi says that nonsense :: SUBST s => t -> s then it actually refers to `nonsense` in the core with added annotation and not to the `nonsense` in the source file. I think that this confused me. Thanks again, Jan. -- Heriot-Watt University is a Scottish charity registered under charity number SC000278.