{'fraction_non_alphanumeric': 0.034482758620689655, 'fraction_numerical': 0.001567398119122257, 'mean_word_length': 5.110047846889952, '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}}
F-ing applicative functors

Essential to ML-style module systems is the concept of a functor, i.e. a function from modules to modules. Functors are ML’s way of providing generic data structures and reusable program components. Yet, there is a bewildering schism in ML land regarding the actual semantics of functors, familiar to experts under the code words generative vs. applicative. In Standard ML [3], each application of a given functor ‘generates’ fresh copies of all the abstract types the functor defines. For example, two applications Set(Int) of a functor defining an abstract set type will produce two distinct and incompatible instances of this type. For OCaml on the other hand, Leroy [2] suggested a semantics where every application of the same functor to the same argument (under certain syntactic restrictions) reproduces the same type. Consequently, every application Set(Int) would result in the same set type. That is, the functor is ‘applicative’, in the sense that it behaves purely functionally. Applicative functor semantics is more flexible in handling certain modularity scenarios, such as “diamond import” dependencies, where the same functor is used along different paths, without creating type incompatibilities. But it also is far more intricate: