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,251
    • Issues 5,251
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 561
    • Merge requests 561
  • 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
  • #16527
Closed
Open
Issue created Apr 03, 2019 by Ryan Scott@RyanGlScottMaintainer

GHCi 8.8+ parenthesizes GADT fields incorrectly with :info

Load the following code into GHCi using 8.8 or later:

{-# LANGUAGE GADTs #-}
module Bug where

data T where
  MkT :: (Int -> Int) -> T

And then try :info T:

λ> :info T
data T where
  MkT :: Int -> Int -> T
        -- Defined at Bug.hs:4:1

Eek! Those parentheses around Int -> Int are required, but aren't showing up here.

This is my fault, as I accidentally introduced this regression in commit 9d9e3557. When pretty-printing fields in a GADT type signature, I should have been using funPrec, not topPrec, since the fields are interspersed with arrows. Unfortunately, no regression tests existed to catch my mistake.

Patch incoming.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking