简体   繁体   中英

Could not load my own modules in ghci haskell

i am trying to load a module called Point.hs into a file called Circle.hs by this way:

module Figures.Circle 
( Circle(..)
  , getArea
  , getPerimeter
) where

import qualified Figures.Point as P

here is my Point.hs file:

 module Figures.Point  
( Point(..)  
) where  

this is my directory´s tree:

  • Figures/
    • Point.hs
    • Circle.hs

and this is what ghci´s error says:

Circle.hs:7:1: error:
    Could not find module `Figures.Point'
    Locations searched:
      Figures\Point.hs
      Figures\Point.lhs
      Figures\Point.hsig
      Figures\Point.lhsig
  |
7 | import qualified Figures.Point as P

I follow this guide .

I get the same error if I call ghci from within the Figures directory, that can be avoided by calling ghci from the parent directory, so ghci Figures\Circle.hs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM