
Donn Cave wrote:
On Fri, 12 May 2006, Brian Hulley wrote:
Udo Stenzel wrote:
I'd like one as a scripting environment, a bit like scsh, just strongly typed and easier on the eyes. Haskell as interactive shell would be a nightmare indeed, having to type 'system "foo"' instead of simply 'foo' for everyday commands just won't cut it.
This seems to be your only objection. It might be solvable by making some rule that an identifier that's used in a value position would be automatically bound to a function/value found by instantiating to a binary in the file system if it's not already bound, and there would need to be some rules about how binaries would work to cooperate with the Haskell type system.
What about the parameters - certainly there's little point in relieving me of the bother of quoting a command name, if I have to quote each parameter?
My idea of a Haskell shell would be that everything in the computer would be visible as a strongly typed monadic value, so for example, instead of typing $ ghc -c -O1 Main.hs ghc would appear in the shell as if it was a normal Haskell function with this type: ghc :: GHCOptions -> [FileName] -> Shell () where GHCOptions would be a record. For each binary, there would be default options, so from Haskell you could type: Shell> ghc ghcDefaultOptions{link=False, opt=1} ["Main.hs"] It might even be possible to make a syntactic extension to Haskell that any function whose first argument is a record could be called with the record brackets immediately after the function name, (ie with an implicit default record based on the name of the function before the opening brace) so the above could be written as: Shell> ghc{link=False, opt=1} ["Main.hs"] There would have to be some specification somewhere to tell the binder what the type of the binary (and its options) was etc. Regards, Brian.