Hi Manlio 2009/1/15 Manlio Perillo <[email protected]>: > Note that it seems you have sent this message only to me; > I'm sending the reply to both you and the mailing list.
Yes, sorry, I always forget forwading to the mailing list. :( > By the way, here is a strange (for me) problem I hit, and made me think > about this extension. > > Suppose a file foo.hs defines: > > import Control.Monad > import System.Posix.Files as PF > > > isDirectory :: FilePath -> IO Bool > isDirectory path = > PF.isDirectory `liftM` PF.getFileStatus path > > > If I try to load the file from ghci I get: > > Prelude> :l foo.hs > [1 of 1] Compiling Main ( foo.hs, interpreted ) > Ok, modules loaded: Main. > *Main> isDirectory "/var" > > <interactive>:1:0: > Ambiguous occurrence `isDirectory' > It could refer to either `Main.isDirectory', defined at foo.hs:6:0 > or `PF.isDirectory', imported from > System.Posix.Files at foo.hs:2:0-30 > That's exactly the problem of "function call hi-jacking". [1] In Haskell it's solved using qualified imports. Cheers, Artyom Shalkhakov. [1] http://digitalmars.com/d/2.0/hijack.html _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
