Open phadej opened 5 years ago
I think adding the generic-data dependency may have been a mistake on my part. I'll check it out.
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.
base 4.9 puts template haskell at 2.13 I believe.
:thinking:
-- Hack for bug in older Cabal versions
#ifndef MIN_VERSION_template_haskell
#define MIN_VERSION_template_haskell(x,y,z) 1
#endif
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.
I've pushed a patch to https://github.com/ddssff/safecopy and made a pull request. Please have a look!
See https://matrix.hackage.haskell.org/#/package/generic-data
safecopy however says
which should be bumped to
>=4.9
Also there are conditionals like
which could be cleaned up