[Haskell-cafe] an automatic refactoring idea
Tom Ellis
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Thu Jan 21 09:12:53 UTC 2016
On Thu, Jan 21, 2016 at 12:08:42AM -0800, Jeffrey Brown wrote:
> I had a data structure with a redundant field [1]. I refactored to make
> that field go away. Here is the code [2]. The following is a simplification
> of it.
>
> I was using this type:
> data X = X1 | X2 Int
>
> To make the Int go away, I made a duplicate type:
> data X' = X1' | X2'
You might be interested in this, specifically the section "The limitations
of refactoring via modifying text files in place, and what to do instead"
https://pchiusano.github.io/2015-04-23/unison-update7.html
Tom
More information about the Haskell-Cafe
mailing list