hunit - What is the Haskell syntax to import modules in subdirectories? -


what haskell's syntax importing modules in directory?

i'm getting started haskell , want practice writing simple functions tdd style hunit. i'm having trouble figuring out how structure files, though. example comes hunit seems flat directory structure.

i'd have tests , hunit code in different folder actual code. i'd appreciate quick example import statement , suggestion how might structure files.

if matters, i'm using ghci , notepad++ coding right now.

you don't haskell source code; instead tell compiler look. usual method in .cabal file. see the cabal user guide details. want "hs-source-dirs" parameter.

alternatively can pass path directly compiler. however, cabal better method.

each pathname in "hs-source-dirs" parameter specifies root of module hierarchy. if import module called "data.foo.bar" compiler looks file relative pathname "data/foo/bar.hs" in each directory given "hs-source-dirs" , imports first 1 finds.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -