[Haskell-beginners] Cross-platform .hs files on Linux and Windows

Vinay Sajip vinay_sajip at yahoo.co.uk
Mon Apr 16 20:23:57 CEST 2012


I've been given a set of .hs files which contain the shebang line

#!/usr/bin/env runhaskell

and I would like them to work on Windows, but none of the Windows binaries seem
to be able to process them without a

<script.hs>:1:1: parse error on input `#!'

These files came from a Linux machine, where they run without trouble. Is there
any way I can get the Windows executables to run these files? I asked on IRC and
it was suggested that I change the files to literate Haskell, but I'd rather
have some way of having cross-platform operation which does not involve making
changes to the scripts themselves. Is there something that can be done e.g. by
using particular command line options or configuration settings?

Thanks & regards,

Vinay Sajip




More information about the Beginners mailing list