Search code examples
haskellghci

Could not find module ‘Network.CGI’ It is a member of the hidden package ‘cgi-3001.3.0.2@cgi-3001.3.0.2-6aj81ZorTUo7RA61f0LJa8’


I am trying to use the liftIO function in the ghci repl.

liftIO appears to be defined in cgi's Network.CGI module. I attempt to import that, entering :m Network.CGI or import Network.CGI, and get the following error

> :m Network.CGI

<no location info>: error:
    Could not find module ‘Network.CGI’
    It is a member of the hidden package ‘cgi-3001.3.0.2@cgi-3001.3.0.2-6aj81ZorTUo7RA61f0LJa8’.
Prelude Api.PesticideApplicationLog> import Network.CGI

How do I import liftIO for use in ghci?


Solution

  • I was trying to import liftIO from the wrong module.

    A hoogle search for liftIO led me to Network.CGI, but the liftIO that I was looking for resides in Control.Monad.IO.Class.

    The import command

    > :m Control.Monad.IO.Class
    

    worked to import the appropriate liftIO for me.