new page
On Tue, 04 Apr 2084, by @lucasdicioccio, 95 words, 0 code snippets, 0 links, 0images.
This article is still considered unfinished and content may change significantly.
how i mature code
- start with a technical type (e.g., foos = Array Foo)
- manipulate the technical type with setters on enclosing object SetFoos (Array Foo)
- create an indirection newtype Foos in a module
- adapt setter to take a Foos
- move technical manipulation in the module
- read-wise: reuse names from the container like isEmpty
- write-wise: collect all SetFoos occurrences with a (params -> Foos -> Foos) function
- create a datatype for each write-function: Modification
- create a modify :: Modification -> Foos -> Foos function with all the collected SetFoos
- replace enclosing object’s handler from SetFoos to ModifyFoo taking a Modification object
- (optional) trace all ModifyFoo’s Modifications