[Haskell] main::[String]->IO() ?

Steffen Mazanek s_mazanek at gmx.de
Wed Mar 24 08:57:39 EST 2004


Hello again.

> Since type signature declarations for functions are generally considered good
> practice, those who use "<- getArgs" would actually need to type two extra
> characters.  And those who do not use getArgs typically (which may or may not
> be the case in general), would type an extra 14 characters.
> 
> One might also consider getProgName and getEnv to be plausible arguments to
> main as they are for some variants of c.  However, in this case we are
> getting quite excessive with main's arguments.

Just a thought: is there a Haskell extensions that allows some kind
of optional function arguments? Not that I want to compare Haskell and
C :-) but as far as I know in C you have the choice. I could imagine
that it may be possible with Template Haskell. Furthermore I see some
analogies with "Formatting: a class act" by Ralf Hinze (as far as I 
understand this (and this is not so deep) value dependent types are 
simulated by type classes).

Bye,
Steffen


More information about the Haskell mailing list