creswick / chatter

A library of Natural Language Processing algorithms for Haskell.
Other
73 stars 24 forks source link

Added `DeriveAnyClass` extension for compatibility with GHC 7.10 #17

Closed rickdzekman closed 9 years ago

rickdzekman commented 9 years ago

chatter wasn't building for me on GHC 7.10.2 because NLP.ML.AvgPerceptron wasn't providing an NFData instance for Feature and Class. I added the DeriveAnyClass extension and included NFData in the deriving list for each.

After that it seems to build fine on GHC 7.10.2.

NB. Because of this issue with regex-tdfa-text I had to install dependencies with FlexibleContexts

cabal install --dependencies-only --ghc-options=-XFlexibleContexts
creswick commented 9 years ago

Thanks for the PR! I haven't had time to look into this yet, but hopefully next week I will be able to (finally) get a 7.10 install going and take a closer look.

I'm also in the middle of a significant refactor of chatter -- see the feature/annotations branch -- which you may want to be aware of. You will want to set an upper bound in your cabal files if you haven't already. 0.6 will break many of the current APIs.

creswick commented 9 years ago

The NFData changes look fine, but need GeneralizedNewtypeDeriving to work without the DeriveAnyClass pragma -- that pragma won't work with older GHCs, which I still want to support ( at least for the time being) so we'd need to bracket that extension somehow -- possibly with CPP?

I added the deriving clauses in 712baf686abfac658b730375f0d5329b2b85bd60; I haven't run into the regex issue yet, though.