Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Text.Zalgo
Description
Provides facilities for generating a wide range of glitched/creepy text through horrifying abuse of diacritics.
- zalgo :: RandomGen g => String -> g -> (g, String)
- zalgoWith :: RandomGen g => ZalgoSettings -> String -> g -> (g, String)
- gradualZalgo :: Double -> String -> StdGen -> (StdGen, String)
- unZalgoWith :: ZalgoSettings -> String -> String
- redact :: RandomGen g => [String] -> String -> g -> (g, String)
- zalgoIO :: String -> IO String
- zalgoIOWith :: ZalgoSettings -> String -> IO String
- gradualZalgoIO :: Double -> String -> IO String
- gradualZalgoIOWith :: ZalgoSettings -> Double -> String -> IO String
- redactIO :: [String] -> String -> IO String
- printZalgo :: String -> IO ()
- printZalgoWith :: ZalgoSettings -> String -> IO ()
- printGradualZalgo :: Double -> String -> IO ()
- printRedacted :: [String] -> String -> IO ()
- data ZalgoSettings
- maxHeightAt :: ZalgoSettings -> Int -> Int
- varianceAt :: ZalgoSettings -> Int -> Double
- overlayProbabilityAt :: ZalgoSettings -> Int -> Double
- numOverlayCharsAt :: ZalgoSettings -> Int -> Int
- overlayCharset :: ZalgoSettings -> Array Int Char
- defaultZalgoSettings :: ZalgoSettings
- unreadableZalgoSettings :: ZalgoSettings
Pure interface
zalgo :: RandomGen g => String -> g -> (g, String) Source #
Zalgo the given text using the default zalgo settings and the given generator.
zalgoWith :: RandomGen g => ZalgoSettings -> String -> g -> (g, String) Source #
Zalgo the given text, using the given algorithm settings and generator.
gradualZalgo :: Double -> String -> StdGen -> (StdGen, String) Source #
Gradually zalgo the given string, starting from the given threshold and linearly scaling towards the default zalgo settings.
unZalgoWith :: ZalgoSettings -> String -> String Source #
Exorcise Zalgo from the given string using the given settings.
redact :: RandomGen g => [String] -> String -> g -> (g, String) Source #
Blot out any occurrence of the given needles in the given string using extreme zalgo.
Effectful interface
zalgoIO :: String -> IO String Source #
Zalgo the given text using the standard settings and a fresh generator.
zalgoIOWith :: ZalgoSettings -> String -> IO String Source #
Zalgo the given text with the given settings, using a fresh standard generator.
gradualZalgoIO :: Double -> String -> IO String Source #
Zalgo the given text using a fresh random generator, starting after the given fraction of the input string, from there on scaling the zalgo factor linearly towards the default settings.
gradualZalgoIOWith :: ZalgoSettings -> Double -> String -> IO String Source #
Zalgo the given text using a fresh random generator, starting after the given fraction of the input string, from there on scaling the zalgo factor linearly towards the given settings.
Printing functions
printZalgo :: String -> IO () Source #
Print zalgo'd text using the default settings and a fresh default generator.
printZalgoWith :: ZalgoSettings -> String -> IO () Source #
Print zalgo'd text using the given settings and a fresh random generator.
printGradualZalgo :: Double -> String -> IO () Source #
Gradually zalgo and print the given text starting at the given threshold. Uses default settings and a fresh system default generator.
printRedacted :: [String] -> String -> IO () Source #
redact
and print the given needles and haystack.
Configuration
data ZalgoSettings Source #
maxHeightAt :: ZalgoSettings -> Int -> Int Source #
Maximum number of diacritics above or below a character at the given position of the input string.
Default: const 10
varianceAt :: ZalgoSettings -> Int -> Double Source #
Maximum random variance in height, as a fraction of maxHeight
, at
the given position of the input string.
Default: const 1
overlayProbabilityAt :: ZalgoSettings -> Int -> Double Source #
Probability of generating an overlay character at the given position of the input string.
Default: const 0.4
numOverlayCharsAt :: ZalgoSettings -> Int -> Int Source #
Number of characters to use for overlay at the given position of the input string. The number of overlays for any character will always be this number or zero.
Default: const 1
overlayCharset :: ZalgoSettings -> Array Int Char Source #
Charset from which to pick overlay characters.
Default: defaultOverlayCharset
defaultZalgoSettings :: ZalgoSettings Source #
The default zalgo settings. Creepy yet readable.
unreadableZalgoSettings :: ZalgoSettings Source #
Settings to make text completely unreadable.