Skip to content

GitLab

  • Menu
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 4,976
    • Issues 4,976
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 477
    • Merge requests 477
  • 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 Compiler
  • GHCGHC
  • Issues
  • #5508
Closed
Open
Created Sep 25, 2011 by mgsloan1@trac-mgsloan1

Template Haskell -ddump-splices lambda pretty printing bug

Parentheses are not placed around lambda expressions when dumping template haskell splices.

One strange thing about this bug is that it only occurs when using "-ddump-splices", and not when using Language.Haskell.TH.Ppr.pprint

x = mkName "x"

thb = QuasiQuoter (const [| $(return . LamE [VarP x] $ VarE x) . id |])
                  undefined undefined undefined 
ghci THPrettyBug.hs -ddump-splices -XQuasiQuotes
GHCi, version 7.2.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[1 of 1] Compiling Main             ( THPrettyBug.hs, interpreted )
Ok, modules loaded: Main.
*Main> [thb| |]
Loading package pretty-1.1.0.0 ... linking ... done.
Loading package array-0.3.0.3 ... linking ... done.
Loading package containers-0.4.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
<interactive>:0:1-8: Splicing expression
    " " ======> (\ x -> x . id)

<interactive>:0:1:
    No instance for (Show (c0 -> c0))
      arising from a use of `print'
    Possible fix: add an instance declaration for (Show (c0 -> c0))
    In a stmt of an interactive GHCi command: print it
Trac metadata
Trac field Value
Version 7.2.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Template Haskell
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