| i would still like to know how one is supposed to display
| the type of class methods, and why 'it' is not bound in the
| same naive way i've used to bind 'output'. once these two
About the it/output thing, I don't know. Can you be more explicit about what
your question is?
Concerning class methods...
| *Main> :b! Control.Monad
| fail :: Monad m -> forall a. String -> m a
I can't explain why this does not print as (Monad m) => ...
I'll try applying your patch when I have a clean build to hand.
| also, if the class method has its own context, as in:
|
| class C a where c :: Num b => a -> b
|
| we get two levels of context, instead of a single merged context:
|
| *Main> :b! Main
| class C a where c :: (Num b) => a -> b
| c :: C a -> forall b. (Num b) => a -> b
I think the right thing here is to change Type.dropForAlls, so that it drops
for-alls nested to the right of arrows. Then you'd get
c :: (C a, Num b) => a -> b
However, if you *ask* to display the foralls, then the only thing to do is to
display the actual type, as you do here:
| *Main> :set -fglasgow-exts
|
| *Main> :b! Main
| class C a where c :: forall b. (Num b) => a -> b
| c :: forall a. (C a) => forall b. (Num b) => a -> b
This *really is* c's type, so it's only honest to say so.
(I'm not sure why -fglasgow-exts switches on forall-printing; that seems odd.
Is it really what GHC does? We should surely have a flag for that.)
Simon
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs