Tue, 16 May 2000 10:54:59 +0200, Jan Brosius <[EMAIL PROTECTED]> pisze:

> > > newSTRef v has type   ST s (STRef s (STRef s a))
> > > (THIS is of the form  ST s (STRef s T(s))
> >
> > No. It has the type
> >     ST s1 (STRef s1 (STRef s a))
> 
> That is indeed what I said in my former email where I stated that
> newSTRef does NOT deliver something with type St s (STRef s T(s))v
> and where you said the CONYRARY.

newSTRef applied to some value can have a type ST s (STRef s T(s)),
thus the type of newSTRef must be as in Haskell, not as you say.

But it does not have such type in your example.

> > When runST' will be applied to a value of the type "ST RealWorld Int",
> > "x" will have the type "ST RealWorld Int".
> 
> I thought that runST does not work on types of the form ST Blurb Int

runST was already compiled into the body of runST'. It does not have
a chance of accepting or rejecting types. What matters when we use
runST' is the type of runST', nothing more. It allows aplying runST'
to any type "s", including RealWorld.

> what's the difference between a -free-type variable and a type
> variable (if not bound by a quantifier)?

f1:: (a -> a) -> [Int] -> [Int]
f1 f l = map f l

This definition does not compile, although f has type a->a.
f does not have the type forall a. a->a.

The type variable "a" in the type of "f" here is bound by implicit
lambda in the definition of f1. It is some concrete type each time
"f1" is used. The type variable "a" in the type "a->a" of the function
"\x -> x" is free, so can be generalized over and the function "\x -> x"
can be instantiated for any choice of "a".

-- 
 __("<    Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/              GCS/M d- s+:-- a23 C+++$ UL++>++++$ P+++ L++>++++$ E-
  ^^                  W++ N+++ o? K? w(---) O? M- V? PS-- PE++ Y? PGP+ t
QRCZAK                  5? X- R tv-- b+>++ DI D- G+ e>++++ h! r--%>++ y-


Reply via email to