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!)