Hello,
Im writing app in haskell and I would like to export some functions and datatypes to other files and then be able to use them in my main file.
How to do this ?
thanks for help
Hello,
Im writing app in haskell and I would like to export some functions and datatypes to other files and then be able to use them in my main file.
How to do this ?
thanks for help
The Wikibooks page on Haskell modules would be a good starting point, or the relevant section of Learn You a Haskell (especially the "Making our own modules" part).
You could lay out your source code like so:
Main.hs
A/Module.hs
You need to specify in A/Module.hs
which module it actually is; it has to be:
module A.Module where
...
In Main.hs
, you import A.Module
; all names are exported by default.