Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,246
    • Issues 5,246
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 562
    • Merge requests 562
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #4436
Closed
Open
Issue created Oct 25, 2010 by Simon Peyton Jones@simonpjDeveloper

Render multi-line strings more prettily in Template Haskell

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.

Trac metadata
Trac field Value
Version 6.12.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking