-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataKinds is not enabled #11
Comments
The latest version on Hackage (0.2.0.0) of Argon uses Haskell-Src-Exts to parse the code. The problem with this approach is that one has to tell Haskell-Src-Exts which extensions should be loaded at compile time! This is unfortunate, since one cannot simply enable all extensions, as some extend the syntax in different ways. Argon had a very comprehensive extension list, see: Line 19 in 1f759ab
But, as you have seen, it's not enough. Fortunately, this has been solved. I managed to replace Haskell-Src-Exts with the GHC API, and now Argon should be able to parse every valid module (one that hasn't syntax errors). If you try the version from master, it should work. If instead it does not, can you provide the code that Argon cannot parse? I tried with the first snippet at |
That sounds wonderful :) I've had issues with Haskell-Src-Exts in the past as well - another issue they (actually get right and GHC gets wrong) is with -XMultiParamTypeClasses and contexts - the following is valid: {-# LANGUAGE MultiParamTypeClasses #-}
foo :: Foo a b => a -> b But GHC doesn't need the LANGUAGE pragma, while Haskell-Src-Exts does. Anyway, I'm glad you were able to switch over! Are you using hint for the api? Or just raw GHC? I'll try compiling the master branch, thank you for all your work! This tool is amazing! |
I'm glad that you're finding Argon useful! It's actually in a very early stage and can be improved a lot. As of now I'm using plain GHC API. One major problem is that I'm only sure it works for GHC >=7.10. I've seen in Hint code it's possible to support previous versions, although this requires adding a lot of ugly P.S. That issue you mention is a weird one! It's odd that GHC does not require the pragma. |
I'm closing this as it's working with GHC >= 7.8. If you experience any problems, feel free to reopen or open a new issue altogether. |
Is this related to how the cyclomatic complexity algorithm is designed? Does DataKinds bork everything because expressions become types? I have no idea how the complexity analysis works, I will read up on it to catch up.
The text was updated successfully, but these errors were encountered: