
Hi, 'import' allows one to say 'hiding' to a list of names. Is it possible to do the opposite, i.e., list the names I want to import? Something like "import Module showing x"? Thanks, Maurício

You mean like this?
import Data.List (foldl', nub)
Or am I misunderstanding your question?
Paulo
On Mon, Sep 15, 2008 at 2:26 PM, Mauricio
Hi,
'import' allows one to say 'hiding' to a list of names. Is it possible to do the opposite, i.e., list the names I want to import? Something like "import Module showing x"?
Thanks, Maurício
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Exactly! Thanks. Maurício Paulo Tanimoto a écrit :
You mean like this?
import Data.List (foldl', nub)
Or am I misunderstanding your question?
Paulo
On Mon, Sep 15, 2008 at 2:26 PM, Mauricio
wrote: Hi,
'import' allows one to say 'hiding' to a list of names. Is it possible to do the opposite, i.e., list the names I want to import? Something like "import Module showing x"?
Thanks, Maurício
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

You're welcome. By the way, this page seems pretty comprehensive.
http://www.haskell.org/haskellwiki/Import
Also, if my memory serves me, Neil Mitchel raised a question about
extending the import system not long ago.
Paulo
On Mon, Sep 15, 2008 at 2:41 PM, Mauricio
Exactly! Thanks.
Maurício
Paulo Tanimoto a écrit :
You mean like this?
import Data.List (foldl', nub)
Or am I misunderstanding your question?
Paulo
On Mon, Sep 15, 2008 at 2:26 PM, Mauricio
wrote: Hi,
'import' allows one to say 'hiding' to a list of names. Is it possible to do the opposite, i.e., list the names I want to import? Something like "import Module showing x"?
Thanks, Maurício
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Would it make sense to add multiple imports to that wiki page? I'm not sure
if this is supported outside of GHC, but I've found it useful.
1 module Main where
2
3 import qualified Prelude as P
4 import Prelude ((++),show,($))
5
6 main = P.putStrLn (show $ P.length $ show $ [1] ++ [2,3])
On Mon, Sep 15, 2008 at 3:48 PM, Paulo Tanimoto
You're welcome. By the way, this page seems pretty comprehensive.
[snip]

On Mon, Sep 15, 2008 at 3:04 PM, John Van Enk
Would it make sense to add multiple imports to that wiki page? I'm not sure if this is supported outside of GHC, but I've found it useful. 1 module Main where 2 3 import qualified Prelude as P 4 import Prelude ((++),show,($)) 5 6 main = P.putStrLn (show $ P.length $ show $ [1] ++ [2,3])
I don't know if that's exclusive to GHC, but I think it would be nice to have your example on the Wiki -- perhaps at the bottom. We could put it under discussion, if we're not sure. Thanks, Paulo

I've dropped it on the discuss page:
http://www.haskell.org/haskellwiki/Talk:Import
Perhaps others have some input before I stick it on the page.
On Mon, Sep 15, 2008 at 4:36 PM, Paulo Tanimoto
On Mon, Sep 15, 2008 at 3:04 PM, John Van Enk
wrote: Would it make sense to add multiple imports to that wiki page? I'm not sure if this is supported outside of GHC, but I've found it useful. 1 module Main where 2 3 import qualified Prelude as P 4 import Prelude ((++),show,($)) 5 6 main = P.putStrLn (show $ P.length $ show $ [1] ++ [2,3])
I don't know if that's exclusive to GHC, but I think it would be nice to have your example on the Wiki -- perhaps at the bottom. We could put it under discussion, if we're not sure.
Thanks,
Paulo
-- /jve

Yes, just leave out the keyword "hiding".
import Data.Map (Map, insert, lookup)
This is the "safest" way to do imports as you're guaranteed that
changes to the export list that do not affect those qualifiers won't
cause code to stop compiling or become ambiguous.
-- ryan
On Mon, Sep 15, 2008 at 12:26 PM, Mauricio
Hi,
'import' allows one to say 'hiding' to a list of names. Is it possible to do the opposite, i.e., list the names I want to import? Something like "import Module showing x"?
Thanks, Maurício
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (4)
-
John Van Enk
-
Mauricio
-
Paulo Tanimoto
-
Ryan Ingram