How to execute haskell in cygwin

I compiled my helloworld.hs and got the helloworld.o file, I tried. / helloworld, but that didn’t work, so is this the right way to execute helloworld? I use cygwin, I just write $ ghc --make helloworld.hs , and I get helloworld.hi, helloworld.exe.manifest, helloworld.o files, I don’t know what to do, do the following ...

+3
source share
2 answers

As you did not specify anything about how you compiled, for example, which particular compiler you use, we can only guess. The usual way to get the .o (object) file from ghc is to use the -c switch; as stated in the manual, this means "do not mess." Mnemonics "compiles only." Without linking, you only have part of the program, and it cannot be executed. Exactly what needs to be associated with it will depend on the particular object file, and some of them will be populated by default if you just let the compiler run the linker. Binding separately is more complicated.

+1
source

, Cygwin ghc ghc Windows, a.out ( ), helloworld.exe. a.out, .exe, Windows.

ghc, : ghc -o helloworld.exe --make helloworld.hs.

, ghc --help :

Haskell, :
ghc-6.8.2 --make Main
Main Main.hs( Main.lhs) . , a.out' (or Main.exe ' Windows).

+3

Source: https://habr.com/ru/post/1756236/


All Articles