I use the org-mode blog, I use org-babel to evaluate the code as follows:
import Data.Function (fix)
f :: Int -> Int
f = (+ 1)
main :: IO ()
main = do
putStrLn $ show $ f 1
: <interactive>:9:25: Not in scope: ‘f’
I found that org-babel for haskell uses infer-haskell mode to start a session and eval code. I also say that the session was created, and if I do not define the function, but directly put "hello" putStrLn, it works.
hope anyone can fix the error :)
source
share