Add showMultiLineString to GHC.Show
authorsimonpj@microsoft.com <unknown>
Mon, 25 Oct 2010 15:16:55 +0000 (15:16 +0000)
committersimonpj@microsoft.com <unknown>
Mon, 25 Oct 2010 15:16:55 +0000 (15:16 +0000)
commite8d11b1e7e72113722a593bf0c43875751a9a6ad
tree5ef67fac01a418b6bfd098d44204c9266723ea16
parent5ad136fba6983ab670599872bdbd61f32cfff914
Add showMultiLineString to GHC.Show

This is part of the fix for #4436

  showMultiLineString :: String -> [String]
  -- | Like 'showLitString' (expand escape characters using Haskell
  -- escape conventions), but
  --   * break the string into multiple lines
  --   * wrap the entire thing in double quotes
  -- Example:  @breakMultiLineString "hello\ngoodbye\nblah"@
  -- returns   @["\"hello\\", "\\goodbye\\", "\\blah\"" ]@
  -- where those "\\" are really just a single backslash
  -- (but I'm writing them here as Haskell literals)
GHC/Show.lhs