This is what I have,
doubleMe :: int->int
doubleMe x = x + x
And when I run it on notepad++
ghc hw.hs
Process started >>>
[1 of 1] Compiling Main ( hw.hs, hw.o )
hw.hs:1:1: The function main' is not defined in module `Main'
<<< Process finished.
================ READY ================
how do i make this program so its interactive?
Currently, you’re running the program with
ghc. What you want to do is first runghciand then use the:loadcommand to load your file. Something like this:You can also load the file when calling the command:
ghci blarg.hs. This might work better with Notepad++ than using:loadfrom the GHCi prompt.GHCi is the command for running the Haskell REPL, which lets you interactively evaluate expressions.
I don’t have Notepad++ handy to check, but I’m sure there is some way to tell it to run
ghciin the background and load files into it instead of usingghcdirectly.If there isn’t, you can always just run
ghciin its own terminal window. In this case, you can use the:rcommand to reload a file after you’ve loaded it for the first time. This will save you quite a bit of typing. (:rvs:load blarg.hs)