Another problem with your code is that you refer to Data.List.sort as List.sort. You need to refer to it as either Data.List.sort or just sort. If you want to refer to it as List.sort, your import statement would need to be import Data.List as List or import qualified Data.List as List (the latter would make it illegal to refer to the functions defined in Data.List without prefixing them with List. while the former would allow both List.sort and sort).
There are three things you can do with a Haskell file (assuming you're using GHC):
Open it in the interpreter. You do this by writing ghci myfile.hs. Once you've done this you can examine the values of the variables defined in your file, call the functions defined in your file and evaluate arbitrary Haskell expressions using the variables and functions defined in your file.
Compile your file as a module that can be used by other modules. For this your file needs to start with module FooBar where where FooBar can be any identifier that starts with a capital letter and isn't Main, but the file name needs to be equal to the module name. You can then compile the module using ghc FooBar.hs and import it from other Haskell files that can then use the functions and variables defined in your module.
Compile your file as an executable. For this the file needs to either start with module Main where or not start with a module definition at all. It also needs to define main with the type IO (). main will then be run when your executable is invoked. You can compile it using ghc myfile.hs.
In your case you called your module Main, but did not define main. Therefore the only thing you can do with your file is to load it in the interpreter. If you want to compile it into an executable, you'll need to define main. If you want to use it as a module from other files, you'll have to name your module something other than Main.
Possibly a bit late to reply to this but it will stand as an excellent reference point. Firstly I will show you the mistakes in that code.
As sepp2k pointed out, you must define a main function if your module is called Main. In Haskell, the GHCi interactive interpreter will allow .hs and .lhs files to be accepted without a Main module, and you can just run your function which in this case is num.
Fixing the code it looks like this:
module Main where
numbers :: [a]
numbers = [6,2,1,7,9] --List of numbers
num :: [a]
num = sort numbers -- Sort numbers using the sort function from Data.List
main = do
putStrLn num -- Allow the num function to be ran when the program executes.
From this we can define other sorting functions to use in place of sort. Here is quicksort.
qsort :: Ord a => [a] -> [a]
qsort  = 
qsort (x:xs) = qsort l ++ [x] ++ qsort r
l = filter (< x) xs
g = filter (>= x) xs