OK, I admit it. I didnt play with GHCi at all when it was first available ... because I was on windows... but I have started to play with it a bit with the latest installer... and let me say: Nice Job GHC team! Cheers! __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday 27 October 2001 16:36, Ronald Legere wrote:
OK, I admit it. I didnt play with GHCi at all when it was first available ... because I was on windows... but I have started to play with it a bit with the latest installer... and let me say:
Nice Job GHC team!
Still, having come from that realm of old-school-AI-language-interpreters I have difficulty using GHCi because I can't define functions interactively. Would it be possible to introduce a mode to do that? I know that the semantics of haskell would make this considerably difficult, but I presume it could be done by you currying wizards out there. ;) I imagine something like defining and undefining functions (and types, etc) , and perhaps going into "interactive" modules which would be separate namespaces. And if LISP can do it, why can't you? ;) That might be a lot more comfortable for sketching a piece of code. Thanks, - -- Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr> Comp. Sci. Dept., Bilkent University, Ankara www: http://www.cs.bilkent.edu.tr/~erayo GPG public key fingerprint: 360C 852F 88B0 A745 F31B EA0F 7C07 AE16 874D 539C -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE73bzTfAeuFodNU5wRArUvAJ46ciU0tc7d1TWYEBE/mbS2oMUu3wCcCNLR pXMZ4e8Vi35i+XrUkTACJxU= =JMdW -----END PGP SIGNATURE-----
Eray Ozkural wrote:
I have difficulty using GHCi because I can't define functions interactively. Would it be possible to introduce a mode to do that?
You can do this: Loading package std ... linking ... done. Prelude> let f x = 1+x Prelude> f 2 3 Prelude> let {g 1 = 1; g n = n-1} Prelude> g 1 1 Prelude> g 2 1
That might be a lot more comfortable for sketching a piece of code.
You can't type f [] = 1 f [x] = x because how would the interpreter know when you'd typed the whole definition? But using let (without the in) looks like what you want. Jón -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk 31 Chalmers Road jf@cl.cam.ac.uk Cambridge CB1 3SZ +44 1223 570179 (after 14:00 only, please!)
participants (3)
-
Eray Ozkural (exa) -
Jon Fairbairn -
Ronald Legere