#4436: Render multi-line strings more prettily in Template Haskell
---------------------------------+------------------------------------------
Reporter: simonpj | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.12.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Kathleen Fisher writes: In the quasi-quoter, would it be hard to have the
code that reports an error print the quoted string using putStrLn instead
of show? For example, I get error messages like the following:
{{{
Examples/Simple.hs:1:1:
Exception when trying to run compile-time code:
user error ("Examples/Simple.hs" (line 73, column 38):
unexpected "\""
expecting identifier or "[")
Code: Language.Haskell.TH.Quote.quoteDec
forest
" type Hosts_f = File Hosts_t -- Hosts_t is expected
to be a PADS type \n\n type Scores_d = Directory { scores :: File
Ptext }\n\n type Simple_d (file_name :: String ) = Directory \n
{ local is \"local.txt\" :: File Hosts_t where <| (get_owner
local_md) == \"kfisher\" | \n , remote is
<|file_name ++ \".txt\"|> :: Hosts_f where <| (get_modes remote_md)
== \"-rw-r--r--\" |>\n , nested is <|getHost
local|> :: Scores_d where <| (get_group nested_md) ==
(get_owner local_md) |> \n , mylink_sym is
\"mylink\" :: SymLink where <| mylink_sym == \"quantum\"
|>\n , mylink ::
Scores_d\n-- , mylink
:: SymLink Scores_d where <| sym_link mylink == \"quantum\" |>\n
, airef is ai_file :: File AI_t\n
} "
}}}
It'd be a lot easier to find the syntax error if all those '\n's were
printed as newlines.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4436>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs