Suppose your Haskell file contains the following
doubleUs x y = doubleMe x + doubleMe y
doubleSmallNumber' x = (if x > 100 then x else x*2) + 1
What would you expect “Build” to do?
Running this file does not have a definite meaning: running which function? With which arguments?
What it does depends on the contents of your “Haskell.sublime-build” file which by default is
{
"shell_cmd": "runhaskell \"$file\"",
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.haskell"
}
Now, runhaskell is a script that executes the “main” function, when defined in your file.
Look in the docs for how to write the main function and you should be ready to go.
In my configuration I put a custom “Haskell.sublime-build” file in my User directory with
{
"selector": "source.haskell",
"working_dir": "$file_path",
"cmd": "gnome-terminal","-x","ghci", "$file"]
}
which, under a gnome-like environment will launch a console running ghci loaded with your script so you can play with it.