I'm writing my first big project in Haskell and I'd like to split it across multiple files. So far, I have written two modules, Parse
and Eval
. I'd like to have a Main
module that just includes these two modules and specifies the main
function. I have the files Main.hs
, Parse.hs
, and Eval.hs
and import them in Main
, but this happens:
Prelude> :load "~/code/haskell/lisp/Main.hs"
[1 of 3] Compiling Eval ( Eval.hs, interpreted )
[2 of 3] Compiling Parse ( Parse.hs, interpreted )
[3 of 3] Compiling Main ( ~/code/haskell/lisp/Main.hs, interpreted )
Ok, modules loaded: Main, Parse, Eval.
*Main> parse parseExpr "" "#b101"
<interactive>:1:0: Not in scope: `parse'
The parse
function comes from Parsec library, which is imported in Parse.hs
. What's wrong?