In article <[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> To recap, there were two arguments for getArgs to remain with the
> IO [String] type:
As was argued earlier, it seems the correct thing would be to retype
"main":
main :: [String] -> IO ()
or
main :: (?args :: [String]) => IO ()
or
type ReturnCode = Int
main :: [String] -> IO ReturnCode
I sometimes dream of an approach where all system services are provided
by implicit parameters supplied to "main":
main :: (?stdin :: Handle,
?stdout :: Handle,
?stderr :: Handle,
?filesystem :: FileSystem,
?internets :: [InternetConnection],
?gettime :: IO UTCTime,
...
) => [String] -> IO ReturnCode
Of course, this would make a bit more sense if there were a mechanism
for applying type contexts to modules, so that they applied to all
declared type signatures.
--
Ashley Yakeley, Seattle WA
_______________________________________________
Haskell mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell