Hello World
We can now see the famous Hello World program in src/Main.flix file:
def main(): Unit \ IO =
println("Hello World!")
That’s it!
You will immediately notice a few things are different from other programming languages:
- The
mainfunction has no formal parameters, in particular it does not take an arguments array. Instead the command line arguments are available by calling theEnvironment.getArgsfunctions. - The return type of the
mainfunction isUnit. - The
mainfunction has theIOeffect since it prints to the terminal.