The playground says "please fix the error in the Haskell module", but no error is displayed (and the project builds fine with cabal build using HFM's command line tools)
4 comments
-
Manuel Chakravarty Official comment I have investigated this in more detail and added some CPP support to Haskell for Mac. Specifically, HfM now bundles `cpphs` and uses it when the `CPP` language pragma is being used.
Unfortunately, this isn't quite sufficient for your project. Specifically, for the file in your screenshot above, I get the following error message:
cpphs: Cannot expand #if directive in file /Users/xyz/Code/lamdu.hsproj/Text/PrettyPrint/HughesPJClass/Compat.hs at line 9 col 1:
MIN_VERSION_pretty(a,b,c) is not a defined macroI am not sure whether that macro should have been defined. Currently, errors from `cpphs` go into the OS X Console as GHC API doesn't provide them with proper error location info.
Another problem with CPP in HfM is that files that contain pre-processor directives are not syntax highlighted as the tokeniser can't deal with the pre-processor directives. This is too much to fix in the upcoming version. (I really only want to fix bugs at this point and not add features that might destabilise things.)
I have made a ticket to fix these things in the following version, though.
-
Manuel Chakravarty It is very likely that the underlying cause of this problem and http://community.hfm.io/hc/en-us/community/posts/209278377-Modules-with-sub-modules-like-Data-X-and-Data-X-Y-don-t-work is the same. If you can help me re-create the project (see comment on the other report), I will look at both problems together.
-
Yair Chuchem I now have 1.2.1-beta1 (1113b DMR) and while the other problem is fixed, I still experience this one.
-
Manuel Chakravarty Thanks for the feedback. I did have a look at that and the problem is that some modules use the `CPP` language extension. As Haskell for Mac cannot depend on Xcode or its command line tools being installed, it cannot depend on the C-preprocessor. (Also problematic is that the use of the C-preprocessor goes through `xcrun`, which we are not allowed to use in an app sandbox.)
I am wondering whether using `cpphs` might be an option if I bundle it with HfM. Have you tried using `cpphs` for your purposes?