Import the "base" System.IO

In packages-haskell2010 / System / IO.hs we have the following line:

import "base" System.IO hiding (openFile, hWaitForInput)

This form import(where it is followed by a string, and then by the module name) is not documented on Import . Do I correctly assume that String (in this case "base") simply refers to a directory?

+3
source share
1 answer

The line refers to the package as it is a batch import . This extension is included.

{-# LANGUAGE PackageImports #-}

You can use this to enable this module from a named package. In your case, it will import System.IOfrom the "package" base:

-XPackageImports GHC , . :

import "network" Network.Socket

Network.Socket ( ). , , , .

, , ghc-pkg list. , ghc-pkg recache, cabal, recache ( ).

+7

All Articles