Sun, 4 Jun 2000 11:02:20 -0700, Levent Erkok <[EMAIL PROTECTED]> pisze:
> Yes, we're working on a new semantics for do, where you'll be able
> to bind variables recursively. For instance:
>
> do xs <- Just (1:xs)
> return (take 5 xs)
Ah, like:
import MonadFix -- Andy Gill's module, present in GHC.
...
do
xs <- mfix $ \xs -> Just (1:xs)
return (take 5 xs)
The Monad class would have a kind of the mfix method, right?
> But a let-generator will be visible everywhere:
>
> do .... -+
> .... |
> let f = ... |> f is visible everywhere (but is monomorphic)
> .... |
> .... -+
>
> but it will not be polymorphic.
And "<-"-bound variables would be visible everywhere too?
I'm curious how the generic translation into mfix could look like if
everything is visible everywhere, e.g.:
do
a <- f1 b
b <- f2 a
return (a,b)
--
__("< 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-