v217
v217

Reputation: 805

How can I tell runhaskell that a module is not in the same folder?

I want to place a module in a different folder. Is there a possibility to tell in the import statement the path to the module? Note I don't want to use cabal, because in the editor I use, runhaskell is the default executable for haskell.

Upvotes: 2

Views: 649

Answers (1)

shang
shang

Reputation: 24832

You can use the -i flag to define an include dir, for example

runhaskell -isrc MyModule

Also, if you have a .cabal-file in your project you can invoke runhaskell with the same source folder and package configuration via cabal exec:

cabal exec runhaskell -- MyModule

Upvotes: 6

Related Questions