Open mwookawa opened 7 years ago
hs-boot files are ghc's workaround for haskell not being able to cope with mutually dependent modules.
Basically if you have a cycle of .hs files you pick one and copy the minimum amount of stuff necessary to build the next into a corresponding .hs-boot file, and that lets it do initial builds of the subsequent files until it can build the real .hs file for that module.
It's an unsafe mechanism, in the sense that if the .hs-boot file is wrong or goes out of date you'll likely get SIGSEGV from the resulting program.
(a better answer is to refactor the offending files but that can be expensive)
(also, if you don't want .lhs, wouldn't it be better to just exchange the comment and non-comment lines, that is, put -- in front of all the comment lines and remove the > from the code lines, rather than deleting all the comments?)
the hs-boot files for fof are actually tiny and safe -- i wasn't sure how to run them through the preprocessor, as fname.lhs-boot they pops out of the ghc unlit preprocessor as fname.hspp, which clobber the preprocessor output of fname.lhs.
ah, unlit them and call them foo.hs-boot and that should do the trick.
yep yep! thanks!
not done yet; there is a ton of annoying whitespace left by unlit, and i haven't figured out how lhs-boot files are used (seem like stubs. i'm probably missing something stupid).