packages feed

acme-zalgo 0.1.2.0 → 0.1.2.1

raw patch · 2 files changed

+14/−16 lines, 2 filesdep ~basePVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

Dependency ranges changed: base

API changes (from Hackage documentation)

+ Text.Zalgo: defaultOverlayCharset :: Array Int Char

Files

Text/Zalgo.hs view
@@ -15,10 +15,11 @@   , maxHeightAt, varianceAt, overlayProbabilityAt   , numOverlayCharsAt, overlayCharset   , defaultZalgoSettings, unreadableZalgoSettings+  , defaultOverlayCharset   ) where import Data.Array (Array, listArray, bounds, elems, (!))-import Data.Char (chr)-import Data.List (foldl', isPrefixOf)+import Data.Char (ord, chr)+import Data.List (foldl', isSuffixOf, isPrefixOf) import System.Random (RandomGen, StdGen, newStdGen, randomR, randomRs, split)  -- TODO: sporadically zalgo a text using Perlin noise@@ -27,7 +28,7 @@   { -- | Maximum number of diacritics above or below a character at the     --   given position of the input string.     ---    --   Default: const 10+    --   Default: const 5     maxHeightAt :: Int -> Int      -- | Maximum random variance in height, as a fraction of 'maxHeight', at@@ -58,7 +59,7 @@ -- | The default zalgo settings. Creepy yet readable. defaultZalgoSettings :: ZalgoSettings defaultZalgoSettings = ZalgoSettings-  { maxHeightAt          = const 10+  { maxHeightAt          = const 5   , varianceAt           = const 1   , overlayProbabilityAt = const 0.4   , numOverlayCharsAt    = const 1@@ -70,7 +71,6 @@ unreadableZalgoSettings = defaultZalgoSettings   { overlayProbabilityAt = const 1   , numOverlayCharsAt    = const 7-  , overlayCharset       = redactionOverlayCharset   }  minHeightAt :: ZalgoSettings -> Int -> Int@@ -97,12 +97,6 @@   where     list = map chr $ [820 .. 824] --- | Overlaid and enclosing diacritics, to make text absolutely unreadable.-redactionOverlayCharset :: Array Int Char-redactionOverlayCharset = listArray (0, length list-1) list-  where-    list = map chr $ [820 .. 824] ++ [0x488, 0x489, 0x20dd, 0x20de, 0x20df, 0x20e4]- -- | Combining diacritics below. under :: Array Int Char under = listArray (0, length list-1) list@@ -165,9 +159,12 @@ breakAll :: Eq a => [a] -> [a] -> [[a]] breakAll needle xs =   case break1 needle xs of-    (_, [])    -> [xs]-    ([], xs')  -> needle : breakAll needle xs'-    (pre, xs') -> pre : needle : breakAll needle xs'+    (_, []) | not (needle `isSuffixOf` xs) ->+      [xs]+    ([], xs') ->+      needle : breakAll needle xs'+    (pre, xs') ->+      pre : needle : breakAll needle xs'  -- | Blot out any occurrence of the given needles in the given string using --   extreme zalgo.@@ -175,10 +172,11 @@ redact needles haystack gen = foldl' f (gen, haystack) needles   where     f (g, xs) needle = redact' needle g (breakAll needle xs)+    rot13 c = chr $ (ord c + 13 - 97) `mod` 26 + 97      redact' needle g (x:xs)       | needle == x =-        case zalgoWith unreadableZalgoSettings x g of+        case zalgoWith unreadableZalgoSettings (map rot13 x) g of           (g', x') -> fmap (x'++) (redact' needle g' xs)       | otherwise =         fmap (x++) (redact' needle g xs)
acme-zalgo.cabal view
@@ -1,5 +1,5 @@ name:                acme-zalgo-version:             0.1.2.0+version:             0.1.2.1 synopsis:            A somewhat flexible Zalgo̐ te̳͜x̥̖̉̓͞t̍̌̔ ̀̃t̴̢̞̜͓̝r̶̬̆̂̒͟á̧̡͎͔̯̰̕n̹̾̓ͬͦ̍͘ṡ̢͓͉ͮ͆l̠̖̹̗̳̖̽̌ͤ͞a͚̭͙̹̲ͭͩt͈͐o̢̭͇͍̟͐ͬ̾ͪ͜r͇.̸̅ͭ̐̀̊ͨ͛ description:         "Zalgo text" refers to the glitchy-looking and somewhat eerie text produced by combining Unicode diacritics into an unholy mess. It is sometimes used to to indicate the presence ǒ̲f͓ ͡s͕ome̡͆t̳h̫i̵̤nͮg ͍sͩi̱n̦i̜̕s̺̼͛t̓er̬̃̾ ̛̙̀͟ą̈́n̤͜d ̖m̛̝̽i͖̎n͕͈d̯̀ͥ-ṱ͟wi̜sͤ̕t̡͎͚̓ï̵̆n̢͐ͮ͛g̽ͮ̋ ̗͜e̴̙͊̓͘n̶̔̚ó̻͈u̯ͭg̦h͂ ̪̠͖͑̐͠t̳͓̏̐ͣo̦̠͠ ͓̥b̘̫͛̕r̰̳͞e͇͖̘ä̢̳̤̈́͐k̅ ̛͔̏͝͡r̺̕͜e̶̢̪͓͖á̐́l̺̺̼̇i̷̥͓ͩt̹y,̬̍ ̴̰̰̹̫ͭ̈č̸͓̉ͅã̴͖͕̹͂̿̚͜ǘ̋̕͞ş͚̠͛͟͟iͭ̊ͦͤͯn̷̪̤͔̘̈̃̔ġ̶̮ͮͮ̊̚ ̵̨̙ͩ̀͊͞͡s͌̉e͆v̸͚͗̅̅e͐̓r͑e̷̠͈͡ ̼̰͔̋ͨ̐͆ͧ͟͟c̺̿̈́̐̀͡o͚ͮͮ͗͆͡r̷̢͈̫ͧ̄r͓u̹͙̻͍p͒ͦͮt̻̀̽̚ỉ̢̲̘͚̹ͧ̅ͤȏ̵͙͕ͩ̊͘͝n̵͖̍ ̵̧̩̤͎̦i̱͂̿͝n͉͋͗ ͓̣̖̣aͫ̎́n̵̲̜̯ͭ͗̎̐̀ͪy͑ͮ͗ͥ͡ ̨͓̎̽ͫ̏͊͝ņ̸͔̞̘͖̠̓̀ͫe͓͟a̵̢̰̱ͨŗ̮͕̦̪͞b̴̝̝ͥȳ̦̼͓ͤ̈́̀̌ ̨̼̠̗͟t̙͉̹͍ͪ̄̈͟ͅé̹̗̳ͤ͗̈̽͟͝x̥͙͍̬̥ͅt͍̰̪̔ͯ,ͯͧ̂̐̚̕͡ ̱̜́̊͘͜ǎ̧̟̤͋ͨn̮̹̆̎͗̾͟͡i̮̘̐ͯ͗͌̉͗͘m̛̰̤̩ͦ̏̓ͣ͜ͅ ä̴̦̫́͂̿̌ͦ͝ͅ ̺̲̣̼̦̈͜l̨̬̫̉̋͜͡ ̨̗͈̐ͣ̓́ͣ̃́s̲̞̣͓͗ ̢͉̫͚͍͠ó̠ͩ̽ͯ̍̃͘ŗ̜̈́ͨͨ̾̏̊̔͠ ̱͈ͯ̿̀̂̀̌̈͜ų͙͍͍̹̞̜͗̌͡ṅ̶͖̠̄̆̚ ͍̪̬̮̂̌̑̎ͪ̾f̡͎̮͊͂͐͒̊̿͡ ͚̩̯̼̠̀̃ͨ͘͞ȯ̭̖̻͜ͅr̡̞̟ͫ͜ț̴͎͔̤̒ͥ̌ ͆́͘̚͡û̞̪̮ͧ̌̑̓̎̚ ̻̰̗̠̏́ͪ͡n̠̺ͣ́ͨͥ͋ ̵́͐̒ͧͤ̈́̉̆̚a̭̽̀̎̈͐̌̐ͦ̓t̡̛̔̄̀͋ͩ͂́͝e͊ ̨̯̖̖͕͇̚ş̷̼̥̤͈̱̟ ̙̦̪̙͔ͤ͘͟o̶̻͉̯̟u̵ ̻̬̥ͬ̑ͫͮ͡͠͞H̥̲̣̔̌̚ ̡̬̞̤͈̱̠̬ͪͦE̮̳͉̖̟͑ͬͦ́ ̧̨̹̜C͉̩͓͉̀ͯ̈́̄ͩ͂ ̸͓̳ͤO̡̠̝̬̭̜͙̔̾̈́ ̷̩̻̭̣̲ͦ͊͆M̴͓͊ͬ͌̂̈́͑ ̧̲̬̹̻͖ͭÉ̡̛̬̗͙̜͛ ̮̠̐ͣͫ̉͠͝Ş̥̮̈̉ͧ͂ͩ̀͡!̢͚ͥͪ̿ͯͤͫ͌̀ license:             MIT