[project @ 2002-11-18 14:25:29 by simonpj]
authorsimonpj <unknown>
Mon, 18 Nov 2002 14:25:29 +0000 (14:25 +0000)
committersimonpj <unknown>
Mon, 18 Nov 2002 14:25:29 +0000 (14:25 +0000)
Comments

ghc/compiler/basicTypes/MkId.lhs

index 1ad85bc..c8b00b7 100644 (file)
@@ -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