[Haskell-cafe] Re: Why is getArgs in the IO monad?
Keean Schupke
k.schupke at imperial.ac.uk
Wed Jan 19 04:05:02 EST 2005
Of course both suggestions don't really change anything as:
_main = do
args <- getArgs
main args
(or the equivalent for implicit parameters) is all that is required...
In a way
the implicit parameter approach makes it seem like a normal function...
Do you think implicit parameters could replace
top-level-things-with-identity?
I hadn't really thought of it before (and I don't use implicit
parameters much).
Keean.
Ashley Yakeley wrote:
>In article <41ECD49F.9020601 at imperial.ac.uk>,
> Keean Schupke <k.schupke at imperial.ac.uk> wrote:
>
>
>
>>Surely both requirements can be satisfied if the programs arguments are made
>>parameters of main:
>>
>>main :: [String] -> IO ()
>>
>> Keean.
>>
>>
>
>Better yet, it should be an implicit parameter so as not to break
>existing programs.
>
> main :: (?args :: [String]) => IO ()
>
>You could do the same with standard input and output.
>
>
>
More information about the Haskell-Cafe
mailing list