I am a bit rusty on my Haskell and am looking to ramp back up. One thing I enjoy from F# is the F# Interactive shell integrated with Visual Studio: I can evaluate virtually anything (including function and class definitions) and use F# as a shell. Is there an equivalent in Haskell? When I use ghci, I cannot evaluate function definitions. How do you work around that?
My current preferred setting is using Emacs with haskell-mode and opening an interactive ghi interpreter. However, is there a way to evaluate just region of a file?
You can define a function using ‘let’:
Also, I won’t quite recommend this, since (A) I wrote it, and (B) it’s terribly undeveloped, but Halp can be handy in Emacs — it’s a little bit like a spreadsheet for Haskell code integrated right into your source-code buffer. You can have a set of expressions you’re interested in and with one keystroke see how all their values change depending on your edits since the last reevaluation.