Ticket #1525 (closed feature request: fixed)

Opened 6 years ago

Last modified 4 years ago

:browse shouldn't print single-constructor data definitions twice

Reported by: sorear Owned by: simonpj
Priority: high Milestone: 6.8.1
Component: Compiler Version: 6.7
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Easy (less than 1 hour)
Test Case: ghci011 Blocked By:
Blocking: Related Tickets:

Description

stefan@stefans:~/qhc/qhc-desugar/Qhc/TypeCheck$ ghci Type.hs
Loading package base ... linking ... done.
[1 of 2] Compiling FreshName        ( FreshName.hs, interpreted )
[2 of 2] Compiling Type             ( Type.hs, interpreted )
Ok, modules loaded: Type, FreshName.
   ___         ___ _
  / _ \ /\  /\/ __(_)
 / /_\// /_/ / /  | |    GHC Interactive, version 6.7.20070612, for Haskell 98.
/ /_\\/ __  / /___| |    http://www.haskell.org/ghc/
\____/\/ /_/\____/|_|    Type :? for help.

*Type> :bro Type
unQlType :: QlType -> FreshName.Uniq ([Constraint], Type_)
data Constraint = Type_ :~ Type_
data Constraint = Type_ :~ Type_
data QlType = QlType [Constraint] Type_
data QlType = QlType [Constraint] Type_
data Type_
  = Con Id | Type_ :@ Type_ | Var FreshName.UName | Binding Id
data Type_ = ... | Binding Id
data Type_ = ... | Var FreshName.UName | ...
data Type_ = ... | Type_ :@ Type_ | ...
data Type_ = Con Id | ...
type Id = String
*Type> 

Note the multiple definitions of Constraint and QlType?. My conjecture is that the data and type constructors, both in-scope, are both being browsed to the data definition; which suggests the (admittedly a little hacky) improvement of not displaying only-child data constructors if the corresponding type constructor is in the same scope.

Change History

Changed 6 years ago by igloo

  • priority changed from normal to high
  • milestone set to 6.8

I don't really see the point of repeating any of them, even if there are multiple constructors. Does anyone know whether or not this was a deliberate change from 6.6?

Changed 6 years ago by simonpj

  • owner set to simonpj

Changed 6 years ago by simonpj

  • status changed from new to closed
  • testcase set to ghci011
  • resolution set to fixed

Fixed. There was a lurking "ToDo?" in InteractiveUI. A reasonable test is ghci011 (whose output had been incorrectly updated).

Simon

Changed 6 years ago by igloo

  • milestone changed from 6.8 branch to 6.8.1

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple

Changed 4 years ago by simonmar

  • difficulty changed from Easy (1 hr) to Easy (less than 1 hour)
Note: See TracTickets for help on using tickets.