18 Dec 23:54
Re: Re[2]: getOpt return record of type a rather than [a]
Lemmih <lemmih <at> gmail.com>
2007-12-18 22:54:55 GMT
2007-12-18 22:54:55 GMT
On Dec 18, 2007 11:28 PM, Bulat Ziganshin <bulat.ziganshin <at> gmail.com> wrote: > Hello Lemmih, > > Wednesday, December 19, 2007, 1:22:43 AM, you wrote: > > Indeed, we to this in HAppS, for instance. Folding the resulting list > > makes the current GetOpt implementation more than adequate. > > this is problem important for me too - i have >50 options. can you > please give us a small example of such approach? Henning posted the specialized structure: data ArgDescr a = NoArg (a -> a) ReqArg (String -> a -> a) String OptArg (String -> a -> a) String which is a same as: type DirectArgDescr a = ArgDescr (a -> a) The "flags" can be combined using: foldr ($) emptyConfig flags. -- -- Cheers, Lemmih
RSS Feed