title: Escaping special chars in Haskell
body: <p>How to escape special characters in String / Text with Haskell? Preferred approach is to use standard solutions ("standard" functions, libraries). So,</p>
  
  <pre><code>"aaa\nbbb\r" must be transformed to "aaa\\nbbb\\r"
  </code></pre>
  
  <p>I found only JSONb library which is totally outdated and depends on old ByteString, so I can't build it. Also there is MissingH but it's collection of anything-anything. Is any standard solution for it, it looks very useful?</p>