Spintax-0.3.5: Random text generation based on spintax

Safe HaskellNone
LanguageHaskell2010

Text.Spintax

Synopsis

Documentation

spintax :: Text -> IO (Either String Text) Source #

Generate random texts based on a spinning syntax template, with nested alternatives and empty options.

λ> spintax "{{Oh my God|Awesome}, {a|the}|A|The} {quick {and dirty |||}||}{brown |pink |grey |}{fox|flea|elephant} jumps over {the|a} {lazy |smelly |sleepy |}{dog|cat|whale}{.|!|...}"
 Right "Awesome, the quick pink fox jumps over a sleepy whale."