Is there a way to promise Haskell that external calls which return
data do not change any state so that you can use them within
functions rather than only within do sequences. It would make certain
classes of CGI applications much easier (I really want a Haskell version
of PHP). Examples:
* Files: there are many programs that assume that file contents are not
changing while they are running (e.g. configuration or password files).
Why can't we treat the file system as if it were like a large Hashtable?
It would be nice to have a function which takes a path and returns the
contents of a file: getFileContent :: String -> String
* SQL: many industrial strength databases provide a snapshot mode where
the state of the database doesn't change for the duration of the
connection. I accept that opening a connection may need to be within a
do sequence. It doesn't make sense to me that SQL select queries should
be. They are functions over a database datastructure in the same way one
might write functions over lists. (based on looking at the ODBC lib from
Dima Skvortsov <[EMAIL PROTECTED]>)
* RPC: same basic idea as with SQL. Many RPC calls are purely
informational.
In general, it seems like an unreasonable requirement that
function calls must be limited to a single executable.
-Alex-
PS I realize that this is really a generic functional programming
question, but I am programming in Haskell and do not know where else to
ask.
___________________________________________________________________
S. Alexander Jacobson i2x Media
1-212-697-0184 voice 1-212-697-1427 fax