Brian Hulley wrote:
moduleOptions = ComposedOption "My module" [ModOption1, ModOption2]
moduleOptions = Option $ ComposedOption "My module" [ModOption1, ModOption2]

allOptions = ComposedOption "Name of program" [Module1.moduleOptions,

allOptions = Option $ ComposedOption "Name of program" [Module1.moduleOptions,

Thinking more about it, it would be better to change the type of ComposedOption to:

   data ComposedOption = ComposedOption [(String, Option)]

since an option by itself can't tell what it's name should be because any name specified might conflict with other option names, but the parent can assign different names safely. Also, many different schemes for composing options could be devised, so that some subsets of options would be indexed by a number instead of a letter etc.

Regards, Brian.

PS: this is definitely a good case for the use of augmented IO since the fact that a particular module needs to store option state should be completely invisible to the rest of the program...
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to