moocfi / haskell-mooc

Haskell MOOC University of Helsinki
Other
307 stars 414 forks source link

Set14b.hs does not load in GHCI #67

Closed RichardJECooke closed 1 year ago

RichardJECooke commented 1 year ago

To reproduce:

Set14b.hs:24:1: error: Could not find module ‘Network.Wai’ Use -v (or :set -v in ghci) to see a list of the files searched for. | 24 | import Network.Wai (pathInfo, responseLBS, Application) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Set14b.hs:25:1: error: Could not find module ‘Network.Wai.Handler.Warp’ Use -v (or :set -v in ghci) to see a list of the files searched for. | 25 | import Network.Wai.Handler.Warp (run) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Set14b.hs:26:1: error: Could not find module ‘Network.HTTP.Types’ Use -v (or :set -v in ghci) to see a list of the files searched for. | 26 | import Network.HTTP.Types (status200) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Set14b.hs:29:1: error: Could not find module ‘Database.SQLite.Simple’ Use -v (or :set -v in ghci) to see a list of the files searched for. | 29 | import Database.SQLite.Simple (open,execute,execute,query,query,Connection,Query(..)) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Failed, one module loaded.

opqdonut commented 1 year ago

You need to use stack ghci so that the packages installed by stack are visible. Does that help?

RichardJECooke commented 1 year ago

Yes, this fixed it, thank you. I thought I'd just used ghci for testing every file up to Set14.