Implict parameters and monomorphism
Marcin 'Qrczak' Kowalczyk
4 May 2001 21:17:58 GMT
Fri, 4 May 2001 16:16:29 -0400, Dylan Thurston <firstname.lastname@example.org> pisze:
> I'm not sure I understand here. One thing that occurred to me reading
> your e-mail was that maybe the implicit universal quantification over
> type variables is a bad idea, and maybe type variables should, by
> default, have pattern matching semantics.
Only for type signatures on patterns and results. It's a ghc/Hugs
extension. You can write:
f' arr :: ST s (a i e) = do
(marr :: STArray s i e) <- thaw arr
These type variables have the same scope as corresponding value
variables. The s,i,e in the type of marr refer to the corresponding
variables from the result of f'. You could bind i,e to new names in
marr, but not s. (Well, now I'm not sure why there is a difference...)
Type variables from the head of a class are also available in the
class scope in ghc.
You use bound type variables in ordinary type signatures on expressions
and let-bound variables in their scope. Unbound type variables in these
places are implicitly qualified by forall, I don't want to change this.
Some people think that type variables used in standard type signatures
(expressions and let-bound variables) should be available in the
appropriate scope. I don't have a strong opinion on that.
__("< Marcin Kowalczyk * email@example.com http://qrczak.ids.net.pl/
^^ SYGNATURA ZASTĘPCZA