Coder Social home page Coder Social logo

Comments (20)

domenkozar avatar domenkozar commented on April 23, 2024 1

This is now a blocker for using GHC 8.0.2 / LTS 8

from derive.

ndmitchell avatar ndmitchell commented on April 23, 2024 1

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.

ndmitchell avatar ndmitchell commented on April 23, 2024

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.

lemmih avatar lemmih commented on April 23, 2024

I finished the conversion but I'm not completely sure it's 100% correct. Do you have regression tests?

from derive.

ndmitchell avatar ndmitchell commented on April 23, 2024

In .ghci if you type :test it will run:

:main --generate
:reload
:main --test

That's the regression tests.

from derive.

lemmih avatar lemmih commented on April 23, 2024

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.

lemmih avatar lemmih commented on April 23, 2024

Did I accidentally mess up the tests? I don't understand how the tests are supposed to work.

from derive.

ndmitchell avatar ndmitchell commented on April 23, 2024

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.

lemmih avatar lemmih commented on April 23, 2024

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.

lemmih avatar lemmih commented on April 23, 2024

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.

lemmih avatar lemmih commented on April 23, 2024

I fixed the test generator code and each test checks out OK. I hope that means it works. :)

from derive.

flip111 avatar flip111 commented on April 23, 2024

Thank you @lemmih :)

from derive.

peti avatar peti commented on April 23, 2024

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.

domenkozar avatar domenkozar commented on April 23, 2024

So much appreciated @ndmitchell

from derive.

ndmitchell avatar ndmitchell commented on April 23, 2024

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.

ndmitchell avatar ndmitchell commented on April 23, 2024

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.

domenkozar avatar domenkozar commented on April 23, 2024

@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.

ndmitchell avatar ndmitchell commented on April 23, 2024

@domenkozar I've released 2.6.2 which hopefully fixes that issue.

from derive.

domenkozar avatar domenkozar commented on April 23, 2024

@ndmitchell thanks, that works :)

from derive.

ndmitchell avatar ndmitchell commented on April 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.