Comments (5)
Thanks for the report! I'll look into it.
from argon.
I think that CPP is somehow messing up the code. The following raises the error:
{-# LANGUAGE CPP #-}
#ifndef HLINT
{-# LANGUAGE ViewPatterns #-}
#endif
{-# LANGUAGE PatternSynonyms #-}
data Counted a = Counted Int [a]
deriving (Functor, Traversable, Eq, Ord, Read, Show)
pattern (:+) :: () => () => a -> Counted a -> Counted a
pattern a :+ as <- Counted (subtract 1 -> i) (a : (Counted i -> as)) where
a :+ Counted i as = Counted (i+1) (a:as)
while this one does not
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE PatternSynonyms #-}
data Counted a = Counted Int [a]
deriving (Functor, Traversable, Eq, Ord, Read, Show)
pattern (:+) :: () => () => a -> Counted a -> Counted a
pattern a :+ as <- Counted (subtract 1 -> i) (a : (Counted i -> as)) where
a :+ Counted i as = Counted (i+1) (a:as)
I also noticed that CPP-related errors sometimes show up when the syntax is correct.
from argon.
Now all files from the lens and concurrent packages are parsed correctly.
The only exception to this rule are C macros of the form __MIN_VERSION_{package}__
which are provided by Cabal and I have yet to figure out how to support them.
from argon.
One option for MIN_VERSION_foo would be to fake them by rummaging through
the package database (or just the output of ghc-pkg list) and taking the
latest version of each as a conservative over-approximation.
That doesn't really help scenarios like stack that avoid using the global
package DB though, there you'd need to find the current sandbox.
On Thu, Oct 29, 2015 at 6:08 AM, Michele Lacchia [email protected]
wrote:
Now all files from the lens and concurrent packages are parsed correctly.
The only exception to this rule are C macros of the form
MIN_VERSION_{package} which are provided by Cabal and I have yet to
figure out how to support them.—
Reply to this email directly or view it on GitHub
#14 (comment).
from argon.
I was hoping that the cabal library had some functions to work with this. I have yet to investigate the issue though.
from argon.
Related Issues (20)
- 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.