Possible unpackFS problem

Alan & Kim Zimmerman alan.zimm at gmail.com
Sat Jan 10 16:03:17 UTC 2015


On further digging I see that Pretty.ftext eventually uses unpackFS, but
outputs it via hPutStr.

So no problem in GHC.

Alan

On Sat, Jan 10, 2015 at 5:39 PM, Alan & Kim Zimmerman <alan.zimm at gmail.com>
wrote:

> While doing further round-trip testing, I cam across the following issue
>
> Original source
>
>     module Deprecation
>     {-# Deprecated ["This is a module \"deprecation\"",
>                  "multi-line"] #-}
>        ( foo )
>      where
>
> Pretty-printed AST via ppr
>
>    (L {examples/Deprecation.hs:(3,1)-(4,30)}
>     (DeprecatedTxt
>      (L {examples/Deprecation.hs:3:1-14} "{-# Deprecated")
>      [
>       (L {examples/Deprecation.hs:3:17-50} {FastString: "This is a module
> \"deprecation\""}),
>       (L {examples/Deprecation.hs:4:14-25} {FastString: "multi-line"})])))
>
> output where the FastString is converted to a string via unpackFS
>
>     module Deprecation
>     {-# Deprecated ["This is a module "deprecation"",
>                  "multi-line"] #-}
>        ( foo )
>      where
>
> So, the ppr (via Pretty.ftext) is able to reproduce the escape characters
> in original string, but unpackFS does not.
>
> Is this a problem for anyone else?
>
> Regards
>   Aan
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20150110/6f52c445/attachment.html>


More information about the ghc-devs mailing list