ye9ane
ye9ane

Reputation: 2009

Haskell main function doesn't print anything after it is run

I have a simple module like this:

module Main where
import Semantic

main = do
    let result = linearize []
    print result

After I click on the .hs file, It only says that modules are loaded successfully and I can't see the final result. Is there anything I don't know?

Upvotes: 3

Views: 2581

Answers (1)

bheklilr
bheklilr

Reputation: 54068

How exactly are you running your code? Normally, you'd use runhaskell to compile and run, or you can do it in two steps with ghc --make. Since it's saying that all modules are loaded successfully, I'm guessing it's getting opened in ghci, which is the interactive haskell shell, which is often used for testing and experimentation. Try running your file with runhaskell.

Upvotes: 4

Related Questions