Opened 7 years ago

Closed 7 years ago

#7117 closed bug (fixed)

Data family constructors defined in GHCi are not in scope

Reported by: parcs Owned by: pcapriotti
Priority: highest Milestone: 7.6.1
Component: GHCi Version: 7.4.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Incorrect result at runtime Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


The following example explains the problem:

> data family Foo a
> data instance Foo Int = FooInt
> :t FooInt

<interactive>:1:1: Not in scope: data constructor `FooInt'

FooInt is defined, but GHCi doesn't recognize it.

Attachments (2)

ghci-data-family.diff (611 bytes) - added by parcs 7 years ago.
Potential fix
0001-Add-test-case-for-7117.patch (1.4 KB) - added by parcs 7 years ago.

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by parcs

Attachment: ghci-data-family.diff added

Potential fix

comment:1 Changed 7 years ago by parcs

Status: newpatch
Type of failure: None/UnknownIncorrect result at runtime

comment:2 Changed 7 years ago by simonmar

difficulty: Unknown
Milestone: 7.6.1
Priority: normalhigh
Status: patchnew

Patch looks ok, we'll need a test too.

Changed 7 years ago by parcs

comment:3 Changed 7 years ago by simonpj

Owner: set to pcapriotti

comment:4 Changed 7 years ago by p.capriotti@…

commit 700d287fb11dadfd1e91875e2008c4002cd883a3

Author: Paolo Capriotti <>
Date:   Mon Aug 13 18:26:34 2012 +0100

    Fix environment update for type instance declarations in GHCi (#7117)
    Patch by Patrick Palka <>

 compiler/typecheck/TcInstDcls.lhs |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

comment:5 Changed 7 years ago by simonpj

Priority: highhighest

Paolo to make a test case, and merge to 7.6.

comment:6 Changed 7 years ago by pcapriotti

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.