I need to make several small blocks of my program in different ways on different platforms. It seems that GHC is not very good at cross-compiling, so I plan to compile the same code on Linux and Windows.
How to do it? Do I have to write many versions of one module, or is there something like preprocessor directives that I can put in my code to conditionally compile one block of code or another?
PS I use GHC and Cabal for management.
source share