Skip to content
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

safecopy added dependency on generic-data which is only GHC >= 8.0 #73

Open
phadej opened this issue Sep 20, 2019 · 6 comments
Open

safecopy added dependency on generic-data which is only GHC >= 8.0 #73

phadej opened this issue Sep 20, 2019 · 6 comments

Comments

@phadej
Copy link
Contributor

phadej commented Sep 20, 2019

See https://matrix.hackage.haskell.org/#/package/generic-data

safecopy however says

base >=4.5 && <5,

which should be bumped to >=4.9

Also there are conditionals like

  if !impl(ghc > 8.0)
    Build-Depends:     semigroups >= 0.18 && < 0.19

  if(impl(ghc >= 7.2.1))
    cpp-options: -DDEFAULT_SIGNATURES

  if(impl(ghc >= 7.1))
    cpp-options: -DSAFE_HASKELL

which could be cleaned up

@ddssff
Copy link
Collaborator

ddssff commented Sep 20, 2019

I think adding the generic-data dependency may have been a mistake on my part. I'll check it out.

@ddssff
Copy link
Collaborator

ddssff commented Sep 20, 2019

At first glance generic-data does look like the best substitute for template Haskell. Its used to compute the number of constructors in a type and the index of a value's constructor. Syb is an alternative, but my understanding is that it is slower.

@ddssff
Copy link
Collaborator

ddssff commented Sep 20, 2019

base 4.9 puts template haskell at 2.13 I believe.

@ddssff
Copy link
Collaborator

ddssff commented Sep 20, 2019

🤔

-- Hack for bug in older Cabal versions
#ifndef MIN_VERSION_template_haskell
#define MIN_VERSION_template_haskell(x,y,z) 1
#endif

@phadej
Copy link
Contributor Author

phadej commented Sep 20, 2019

There's no problem in depending on generic-data. GHC.Generics is nice tool.

There's just quite a lot of cleanup to be made. e.g. there is

#if !MIN_VERSION_base(4,8,0)

or

#ifdef DEFAULT_SIGNATURES

in the code.

EDIT: there seems to be TypeApplications used e.g. so looks like you are commited to GHC-8.0+ anyway, so even it's possible to push support back to ~7.6 or 7.4, it's maybe no worth it.

@ddssff
Copy link
Collaborator

ddssff commented Sep 21, 2019

I've pushed a patch to https://github.com/ddssff/safecopy and made a pull request. Please have a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants