[Haskell-cafe] GetOpt

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Apr 28 04:42:30 EDT 2006

Hello Anton,

Friday, April 28, 2006, 12:54:44 AM, you wrote:

> I really trying to avoid imperative approach. I do have a terribly big
> experience in imperative programming (by the way, you might know one 
> application that I made about 3 years ago. It is Uni-K Sensei for

no. but may be you are heard about ARJZ? :)

> windows). Now, I am breaking my previous habits just to think wider and
> more effective.

yes, yes. but you should know that haskell still are perfect
imperative language and when pure functional approach will be not
enough for your program, you can combine both ways

> Well, I do not care too much about high-speed. My main goal is to write
> a prototype of the language that I am creating. It is a kind of 
> Domain-Specific language. I decided to start from a simple thing. A 
> converter of pgn files with chess notation to javascript to visualize 
> it. Just to have some practice.

if you don't care about speed and write text-conversion program, pure
functional approach may be enough. just use results of GetOpt as
argument to all the routines that depends on any program options

>> my own option-processing routines, it's just about 50 lines long
>> (great demonstration of Haskell power!). all processed options are
>> record in one large record that is passed around all the program. if
>> you get accustomed to global variables, it's using in Haskell is
>> possible but that is not the best way. you can also use implicit
>> parameters (at least in hugs and ghc), but this again makes data
>> dependencies somewhat non-understandable
> Thank you very much. I will see this approach as well. I am still pretty
> concern of using records instead of lists.

what you mean?

>> btw, i suggest you to use WinHugs for debugging program and ghc for
>> final compilation. this makes faster development time together with
>> faster final executable. moreover, making your program compatible with
>> both environments is almost ensure that it will be compatible with
>> coming Haskell standard, Haskell-prime
> Thanks again. I do not use Windows any more. I use Mac or different 
> Unices. I do use ghc everywhere I work with Haskell. For debugging I use
> ghci. Well, and everything within GNU Emacs.

you can use hugs, it works with many environments. according to my
tests, it loads programs 10 times faster than ghci

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com

More information about the Haskell-Cafe mailing list