From fa654d6b16ecda7cc8cb780792ca10ec0e227555 Mon Sep 17 00:00:00 2001 From: simonpj Date: Mon, 18 Nov 2002 14:25:29 +0000 Subject: [PATCH] [project @ 2002-11-18 14:25:29 by simonpj] Comments --- ghc/compiler/basicTypes/MkId.lhs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/basicTypes/MkId.lhs b/ghc/compiler/basicTypes/MkId.lhs index 1ad85bc..c8b00b7 100644 --- a/ghc/compiler/basicTypes/MkId.lhs +++ b/ghc/compiler/basicTypes/MkId.lhs @@ -589,7 +589,22 @@ mkReboxingAlt us con args rhs Selecting a field for a dictionary. If there is just one field, then there's nothing to do. -ToDo: unify with mkRecordSelId. +Dictionary selectors may get nested forall-types. Thus: + + class Foo a where + op :: forall b. Ord b => a -> b -> b + +Then the top-level type for op is + + op :: forall a. Foo a => + forall b. Ord b => + a -> b -> b + +This is unlike ordinary record selectors, which have all the for-alls +at the outside. When dealing with classes it's very convenient to +recover the original type signature from the class op selector. + +ToDo: unify with mkRecordSelId? \begin{code} mkDictSelId :: Name -> Class -> Id -- 1.7.10.4