[Haskell] Re: Why is getArgs in the IO monad?

Jim Apple japple at freeshell.org
Tue Jan 18 03:15:25 EST 2005

I still think I'm missing your point, but let me take a stab at it.

Conal Elliott wrote:

> I'm suggesting you might better understand the
> why of Haskell if you think denotationally (here about the meaning of
> the [String] type), rather than operationally.

The meaning of a type seems to be about what happens operationally. ":: 
[String]" is an operational guarantee, so if we let "getArgs :: 
[String]" that is a promise that there is some list of Strings at runtime.

 > I'm
> guessing that none of those 2^32+1 values is what you'd mean by "length
> getArgs".

Well, I suppose I mean something like an existential type: there is some 
Int that is length getArgs.

Even if this is denotationally different from a value like zero :: Int, 
I think it is also different from getLine :: IO String. It seems to mean 
something between these. I suppose my intuition is that it is closer to 
:: Int


More information about the Haskell mailing list