What I learned - not familair with compiling:
After compiling hello-world.hs, the result executable is hello-world. You are trying to run the source code itself instead of the compiled executable.
- hello-world.hs
main = putStrLn "hello world"
Compiling hello-world.hs:
$ ghc hello-world.hs
[1 of 1] Compiling Main ( hello-world.hs, hello-world.o )
Linking hello-world ...
Compiling the hello-world.hs creates a new hello-world without suffix.
$ tree
.
├── hello-world
├── hello-world.hi
├── hello-world.hs
└── hello-world.o
By that the hello-world ( without suffix. ) is the exacutable
What miss leaded me was in ghci you can do
$ ghci
GHCi, version 8.0.2: http://www.haskell.org/ghc/ :? for help
Prelude> :load hello-world.hs
[1 of 1] Compiling Main ( hello-world.hs, interpreted )
Ok, modules loaded: Main.
*Main> :load hello-world
[1 of 1] Compiling Main ( hello-world.hs, interpreted )
Ok, modules loaded: Main.
*Main>
But as it say it’s interpreted the hello-world.hs
With Bash, Python where hello.sh and hello.py works without compiling,
Thanks all who helped me