Include other files in the scope of the program

I am trying to take the first steps in the haskell world, and for this I decided to use the leksah IDE. However, I'm not sure if this is really a token, but suppose this could be more cab / build issues.

Now I am trying to solve 99 Haskell problems , and for this I opened a new workspace and created a new package. This leads me mainly to the following directory structure:

dist/
  +--- (here be dragons... a lot of hopefully unrelated files)
scr/
  +--- Main.hs
  +--- 01_lists.hs   (<- now that what I want)
99problems.cabal
Setup.lhs

The file My Main.hs is as follows:

module Main ( main ) where
main = putStrLn (show (myLast [1,2,3]) )

which accuses me of that Not in scope: myLast. I can fix this by writing the definition of the definition above for main = putStrLn ..., but I want to split it into different files and include the files in my area.

How it's done?

, - cabal, leksah, - , :load 01_lists.hs REPL. leksah Package -> Extra Files, .

:

  • Fedora 20
  • Haskell- 2013.2.0.0,
    • leksah 0.12.1.3
    • cabal 1.16.0.2 ( cabal repl, Cabal 1.18 , , ).

, cabal. - , ?

+4
1

01_lists.hs Euler01.hs module Euler01. Main.hs import Euler01

+5

All Articles