
Lists are regarded by Haskell 98 as "syntax", so you don't import or hide them. The type [], the constructors [] and : are all not importable or hidable, any more than 'case' is. So you can define your own prelude, but you can't redefine what list syntax means. Simon | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users- | bounces@haskell.org] On Behalf Of Martin Sjögren | Sent: 07 November 2003 10:15 | To: glasgow-haskell-users@haskell.org | Subject: import Prelude ([](..)) | | Hello ghc users! | | In my experiments with analyzing Haskell programs, I frequently use my | own Prelude variants but want to import parts of the real Prelude for | simplicity. | | In ghc 5, I could write: | import Prelude ([](..)) | and then use lists as usual. In ghc 6, though, I get: | "parse error on input `['" | | Is there a secret way to import the list type that I don't know of? Is | ghc 5 or ghc 6 wrong? :) | | Using the "hiding" is not really an option, since I normally want just | one or two types from the Prelude and then provide other things myself. | | | Regards, | Martin | -- | Martin Sjögren | sjogren@debian.org -- marvin@dum.chalmers.se | GPG key: http://www.mdstud.chalmers.se/~md9ms/gpg.html | let hello = "hello" : hello in putStr (unlines hello)

fre 2003-11-07 klockan 11.27 skrev Simon Peyton-Jones:
Lists are regarded by Haskell 98 as "syntax", so you don't import or hide them. The type [], the constructors [] and : are all not importable or hidable, any more than 'case' is. So you can define your own prelude, but you can't redefine what list syntax means.
Well, I don't want to redefine list syntax, quite the opposite. I want to use regular lists together with my stuff (and "my stuff" doesn't include lists at all). So, this is not possible? (Well, it was in ghc 5, but I guess that ghc 5 is wrong, then) Any other suggestions? /Martin -- Martin Sjögren sjogren@debian.org -- marvin@dum.chalmers.se GPG key: http://www.mdstud.chalmers.se/~md9ms/gpg.html let hello = "hello" : hello in putStr (unlines hello)
participants (2)
-
Martin Sjögren
-
Simon Peyton-Jones