I am just starting to learn Haskell and have difficulty understanding the "flow" of Haskell.
For example, in Python, I can write a script, load it into the interpreter, and see the results:
def cube(x): return x*x*x print cube(1) print cube(2) print cube(cube(5))
In Haskell, I can do this:
cube x = x*x*x main = print (cube 5)
Download it with runhaskell and it will print 125 .
Or I could use ghci and manually type in all the functions I want to test
But I want to use my text editor, write some functions, some tests, and Haskell print some results:
-- Compile this part cube x = x*x*x -- evaluate this part: cube 1 cube 2 cube (cube 3) --etc..
Is this possible?
andsoa
source share