Comments (4)
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).
The new version is not available yet on Hackage. The only issue blocking the release is #3. It's not really a problem but it would make installation with Stack much easier.
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
https://www.fpcomplete.com/user/k_bx/playing-with-datakinds
and it worked.
from argon.
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!
from argon.
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 #if
directives. I'm confident that soon Argon will run at least from GHC 7.8 onwards.
P.S. That issue you mention is a weird one! It's odd that GHC does not require the pragma.
from argon.
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.
from argon.
Related Issues (20)
- It doesn't seem to like signatures on pattern synonyms: HOT 5
- fails to parse CPP testing MIN_VERSION... HOT 3
- ScopedTypeVariables does not work with GHC 7.8
- Add -I --include option HOT 3
- Use a streaming library to export parsed data HOT 2
- Add -c, --cabal option
- Solve TypeFamilies and Foreign Import GHC panics
- Increase test coverage
- Add filesystem traversal to the pipeline
- Extensions from the cabal file are not picked up HOT 6
- CPP preprocessing error in the hint library HOT 7
- ExplicitForAll errors, even when RankNTypes is enabled HOT 10
- Explanations on the Config datatype HOT 5
- Search cabal file automatically
- Stack Support HOT 1
- Provide an explanation about how cyclomatic complexity is measured HOT 5
- Odd error about 'DatatypeContexts'
- Cyclomatic Complexity calculation error HOT 5
- Unsupported extension: TypeApplications HOT 1
- Cannnot compile HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from argon.