Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Allow the annotation of a library patch with an updater to old user code #46

Open
Gurkenglas opened this issue Dec 18, 2016 · 5 comments

Comments

@Gurkenglas
Copy link
Collaborator

Gurkenglas commented Dec 18, 2016

This would solve the problem of legacy API.

The PvP fits neatly around it: The leftmost number would be used for version changes that are not annotated with an updater.

Example proposals that would be/would have been made trivial with this (suggest more?):

@hvr
Copy link

hvr commented Dec 28, 2016

Example proposals that would be/would have been made trivial with this

  • Functor-Applicative-Monad

Btw, see https://github.com/hvr/Hs2010To201x for what's involved for the AMP/MFP/MRP monad refactorings; but this is everything but trivial. The proof-of-concept also can't handle all cases except the simplest ones (and tbh, I'm not even sure it's possible to handle almost all cases).

@Gurkenglas
Copy link
Collaborator Author

Of course the library author wouldn't manually implement the updater, they'd just specify it in a way that GHC can then apply with a system like the rewrite rules one.

@sjakobi
Copy link

sjakobi commented Jan 3, 2017

This is a proposal for a tool similar to gofix, right?

In that case this recent comment by ekmett seems to be relevant::

The amount of CPP running around in Haskell with any sort of long support
window makes 'go fix' tools quite shockingly difficult for us to get right.

@hvr
Copy link

hvr commented Jan 3, 2017

The problem is also that it's not a well-formed (non-clever/creative) subset of CPP usage; if it were only e.g. simple #if MIN_VERSION_... at safe boundaries (such that they include a full declaration or some other reasonable AST sub-tree) it would be an easier (but still not trivial) to job to refactor automatically.

@Gurkenglas
Copy link
Collaborator Author

The updater would run after CPP, of course.

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

No branches or pull requests

3 participants