Sat, 20 May 2000 13:13:22 -0700, Simon Peyton-Jones <[EMAIL PROTECTED]> pisze:
> Explicit lists [a,b,c]
> List comprehensions
> Numeric constants (1 means 'fromInteger 1')
> do notation
>
> Here is an idea for an extension to Haskell 98 to support this.
[...]
It has small problems (and IMHO nobody should need to replace the
list type etc.).
What about string literals - do they refer to Prelude list type or
the replacement? The first is a bit inconsistent, the second does
not allow optimizations.
If list comprehensions are translated literally as the report says,
they don't allow optimizations too, unless the compiler is smart
enough to optimize the translation. Currently GHC does not optimize
concatMap (\x -> [x]) into identity.
If the programmer says:
data [a] = () | a:[a]
data () = []
is [1,2,3] a type error (because it gets translated to 1:2:3:[])?
If he says:
data X = Int:Stop
data Stop = []
is [1] permitted?
Is this permitted:
type (,) = Prelude.[]
type [] = Either
f :: (,) ([Int] String)
f = [Left 5, Right "foo"]
Must the type of Main.main be Prelude.IO something, or it can be a
replacement of IO? The latter does not have a semantics, so it must
be the former.
--
__("< 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-