{'fraction_non_alphanumeric': 0.020819341840161182, 'fraction_numerical': 0.0, 'mean_word_length': 5.422413793103448, '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}}
Getting a Quick Fix on Comonads

A piece of functional programming folklore due to Piponi provides Lob’s theorem from modal provability logic with a computational interpretation as an unusual fixed point. Interpreting modal necessity as an arbitrary Functor (in Haskell), the “type” of Lob’s theorem is inhabited by a fixed point function allowing each part of a structure to refer to the whole. However, Functor’s logical interpretation may be used to prove Lob’s theorem only by relying on its implicit functorial strength, an axiom not available in the provability modality. As a result, the well known loeb fixed point “cheats” by using functorial strength to implement its recursion. Rather than Functor, a more faithful Curry to modal logic’s Howard is a closed comonad, of which Haskell’s ComonadApply typeclass provides analogous structure. Its computational interpretation permits the definition of a novel fixed point function allowing each part of a structure to refer to its own context within the whole. This construction further guarantees maximal sharing and asymptotic efficiency superior to loeb for locally contextual computations upon a large class of structures. By adding a distributive law, closed comonads may be composed into spaces of arbitrary dimensionality which preserve the performance guarantees of this new fixed point. Applications of this technique include calculation of multidimensional “spreadsheet-like” recurrences for a variety of cellular automata.