
2012/3/10 Ovidiu Deac
I already tried this approach:
module Main where
import ....
module Colors where red = 1 blue = 2 .....
but the compiler complains at the line "module Colors where". It says: parse error on input `module'
Right, you can have only one module per file. You would define them in a separate file, possibly making use of qualified imports:
module Constants.AColors where red = 1 blue = 2
module Constants.BColors where yellow = 1 red = 2
module Main where import qualified Constants.AColors as AC import qualified Constants.BColors as BC ... -- code that uses AC.red and BC.red
This is not entirely ideal from the standpoint of using types to help manage your data, but without more details as to how you're using them, it's hard to present appropriate solutions. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms