3 ms·
In case of Haskell it's due to the fact that you can't just evaluate any top level form without going through the main. I'm sure it would be possible to design
by yogthos 11y ago
In case of Haskell it's due to the fact that you can't just evaluate any top level form without going through the main. I'm sure it would be possible to design a statically typed language that's REPL development friendly, but none exist currently.
- marcosdumay 11y agoOk, I either don't get what you are saying, or you never really tried Haskell's REPL for real. I've probably run most of the modules I've written in Haskell on the REPL, normally without importing the main one, because I use it for early-stage testing. I've run DB interfaces, network abstractions, and, of course, lots and lots of pure stuff. Just like you describe doing for Clojure. Ok, I don't use an IDE that run stuff automatically at the REPL. On Haskell I import the interesting module, and run it. There is at least one IDE that connects with ghci, but I don't like it, and don't know how far it takes debuging (at a minimum, it evaluates your code and tells you the type of anything - I've tried this).
- deleted 11y ago[deleted]
- belovedeagle 11y agoThis is simply misinformed. GHCI can evaluate/run the IO monad. Syntax: to run and throw away the result, simply type an expression with type IO a: it will be evaluated to IO a, then executed. If GHCI can show values in a, it will (unless a=()). To get the value, say var <- expr.