Refactorings
- Extract method.
- Replace mutable fields with lenses.
- Replace global state with parameter.
- Introduce ReaderT (Kleisli).
- Replace loop with fold.
- Replace recursion with fold.
- Replace inheritance with natural transformation.
- Replace exception with extended response type.
- Replace null with optional.
- Replace optional fields with sum types.
- Replace sum types with optional fields.
- Replace parameter with reduced type.
- Replace mutable variable with recursion.
- Replace similar methods with generic cousin.
- Extract constant.
- Merge into module.
- Extract generic algebra.
- Wrap side effect.
- Pull out effect.
With higher kinded types:
- Generalize over input constraint.
- Isolate business key via data parametrization.
- Remove Recursion from GADT.
- Replace visitor with type class.
- Replace concrete classes with final tagless interpretation.
- Replace final tagless with free monad.
- Replace free monad with final tagless encoding.
- Replace strategy with tagless final.
- Replace subtypes with type class instances.
- Replace pattern matching with type class dispatch.
With dependent types :
- Introduce parameter value dependent constraint.
- Introduce (path) Dependent type.
- Replace (path) Dependent type with type class constraint.