Comments (20)
This is now a blocker for using GHC 8.0.2 / LTS 8
from derive.
Sorry for the radio silence for some time. I'll endeavour to take a look at this over the weekend and see what I can do.
from derive.
There is a branch here: https://github.com/ndmitchell/derive/tree/hse-1.18
It doesn't work, but I certainly did a lot of the conversion.
from derive.
I finished the conversion but I'm not completely sure it's 100% correct. Do you have regression tests?
from derive.
In .ghci
if you type :test
it will run:
:main --generate
:reload
:main --test
That's the regression tests.
from derive.
I get:
*Main> :test
[20 of 25] Compiling Data.Derive.All ( src/Data/Derive/All.hs, interpreted )
src/Data/Derive/All.hs:9:16:
Not in scope: ‘make’
Perhaps you meant ‘take’ (imported from Prelude)
from derive.
Did I accidentally mess up the tests? I don't understand how the tests are supposed to work.
from derive.
Can you try running the tests with the HEAD version, or the last released version, so you can see how they are meant to work? That should give us a clue as to whether you are running the test wrong, or in the conversion something has broken which was not yet visible due to other changes.
from derive.
Can't even successfully run the tests for 2.5.26 with hse-1.17.1
*Main> :test
Generating Arbitrary
[snip]
Testing Arbitrary
[snip]
Type checking examples
src/Language/Haskell.hs:288:31:
Ambiguous occurrence ‘FieldDecl’
It could refer to either ‘Language.Haskell.FieldDecl’,
defined at src/Language/Haskell.hs:210:1
or ‘Language.Haskell.Exts.FieldDecl’,
imported from ‘Language.Haskell.Exts’ at src/Language/Haskell.hs:4:1-57
(and originally defined in ‘Language.Haskell.Exts.Syntax’)
*** Exception: Failed to typecheck results
from derive.
Ah, I see something weird. In this patch, "#19, start moving to haskell-src-exts", you add takeBaseName x == "Data"
to the test filter. That expression is always false and no tests should be generated. That's then combined with a bug that generates invalid code when there are no tests.
from derive.
I fixed the test generator code and each test checks out OK. I hope that means it works. :)
from derive.
Thank you @lemmih :)
from derive.
The lack of support for haskell-src-exts 1.18.x also blocks openSUSE from distributing this package since we're following LTS 8.x, too. Right now, the build fails (https://build.opensuse.org/package/show/devel:languages:haskell/derive), but at some point we'll have to remove derive from the package set.
from derive.
So much appreciated @ndmitchell
from derive.
I've uploaded Derive 2.6, mainly thanks to the work of @lemmih. Can people check it works - the whole package is in a bit of a state (it needs a lot of love applying to it), so I'm no longer as confident the tests mirror real-world usage as I used to be.
from derive.
I noticed that the bounds were too tight to allow HSE 1.19 so have relaxed them. Can someone confirm it works? And let me know if it needs re-adding to Stackage? Ideally if it were readded it would be by someone other than me :)
from derive.
@ndmitchell in following line I get
Pos/Data/Attributes.hs:1:1: error:
Exception when trying to run compile-time code:
Could not convert Decl () to Dec
InstDecl () Nothing (IRule () Nothing (Just (CxTuple () [ClassA () (UnQual () (Ident () "NFData")) [TyVar () (Ident () "h_6989586621679297913")]])) (IHApp () (IHCon () (UnQual () (Ident () "NFData"))) (TyParen () (TyApp () (TyCon () (UnQual () (Ident () "Attributes"))) (TyVar () (Ident () "h_6989586621679297913")))))) (Just [InsDecl () (FunBind () [Match () (Ident () "rnf") [PParen () (PApp () (UnQual () (Ident () "Attributes")) [PVar () (Ident () "x1"),PVar () (Ident () "x2")])] (UnGuardedRhs () (InfixApp () (App () (Var () (UnQual () (Ident () "rnf"))) (Var () (UnQual () (Ident () "x1")))) (QVarOp () (UnQual () (Ident () "seq"))) (InfixApp () (App () (Var () (UnQual () (Ident () "rnf"))) (Var () (UnQual () (Ident () "x2")))) (QVarOp () (UnQual () (Ident () "seq"))) (Con () (Special () (UnitCon ())))))) Nothing])])
src/Language/Haskell/Convert.hs:(124,5)-(132,57): Non-exhaustive patterns in function conv
CallStack (from HasCallStack):
error, called at src/Language/Haskell/Convert.hs:21:87 in derive-2.6.1-Fni1nm1Ws9IAIfnzevXAvI:Language.Haskell.Convert
Code: derive makeNFData ''Attributes
from derive.
@domenkozar I've released 2.6.2 which hopefully fixes that issue.
from derive.
@ndmitchell thanks, that works :)
from derive.
OK, happy for someone to submit this to Stackage, but in doing so, they are taking over at least co-maintainership!
from derive.
Related Issues (20)
- Add Aeson ToJSON/FromJSON
- Enum instances derived with TH crash with "Missing field in record construction
- Unnecessary context when deriving Monoid
- breakage with template-haskell-2.11 (in ghc-8) HOT 15
- to decrease build time, sources should be in separate src/ folder HOT 2
- "derive makeArbitrary" error w/ strict types (8.0.1) HOT 7
- Could not convert Dec to Decl HOT 2
- Errors while using C and GHC preprocessors HOT 1
- TH derivation doesn't work when the type name is qualified HOT 1
- Fails to build under newest derive HOT 3
- Build failure with GHC 8.2 HOT 3
- Example in Data.Derive.UniplateDirect fails HOT 8
- Parse Fails For pattern aliases (MINOR: see issue comments) HOT 3
- Could not convert Type to Kind () ConT GHC.Types.Nat HOT 1
- Could not convert Dec to Decl () HOT 2
- Hackage distribution lacks TestInstances HOT 1
- Could not convert Type to Type () HOT 1
- Upgrade to haskell-src-exts-1.20 HOT 1
- support haskell-src-exts-1.21+? HOT 2
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 derive.