I am writing a very beginner's F# program (F# Core & Visual Studio Code) as follows:
1.Sort.fs
namespace Demo
module Sort =
let rec quickSort list =
match list with
| [] -> []
| head::tail ->
let smalls =
tail |> List.filter(fun c-> c<head)|> quickSort
let bigs =
tail |> List.filter(fun c-> c>=head)|> quickSort
List.concat [smalls;[head];bigs]
2.Program.fs
namespace Demo
open Sort
module Program =
let list = [3;1;8;4;9;5;7;6]
[<EntryPoint>]
let main argv =
list |> Sort.quickSort |> printfn "%A"
printfn "Hello World from F#!"
0
However when I try to open Sort module into Main I am getting following errors:
The namespace or module 'Sort' is not defined.
The value, namespace, type or module 'Sort' is not defined. Maybe you want one of the following: sqrt
Where as, if I take sort module under same file - `Program.fs, everything works fine. Is there anything else needed to refer file as well?
Sort.fscomes beforeProgram.fsin your project. - TheQuickBrownFox