{'fraction_non_alphanumeric': 0.02401601067378252, 'fraction_numerical': 0.004002668445630421, 'mean_word_length': 5.302521008403361, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Technical Report - Porting HaRe to the GHC API

Refactoring[1] is a software development process in which modifications are made to source code to improve the structure of the code without affecting the functionality of the code. Refactorings often have conditions which specify when they can be safely applied. For example, renaming an identifier should not result in any changes to the binding structure of the code. With some programming languages it is possible to automate these refactorings, including checking the conditions associated with a refactoring. HaRe is such an automated refactoring tool for use with programs written in Haskell[6], a lazy functional programming language. HaRe is implemented in Haskell and to perform its task it must parse and analyse Haskell source code. Rather than implement its own Haskell ‘frontend’ (lexer, parser, scope analysis, etc), HaRe uses the Programmatica[2] system. Implementing the refactorings often requires a significant amount of boilerplate code for traversing the Haskell abstract syntax tree representations. To further aid the implementation of the refactorings, HaRe uses the Strafunski[3] generic programming library. This is described in more detail in Section 3.2. The HaRe development team are very grateful to the contributions and support provided to the HaRe project by the Programmatica and Strafunski development teams. Programmatica provides all the components of a Haskell front-end that HaRe needs, but has some limitations: