Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • 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,826
    • Issues 4,826
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 441
    • Merge requests 441
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #15661

Closed
Open
Created Sep 20, 2018 by taktoa@trac-taktoa

Nullary constraint in GHCi breaks `:t` command

If you create a value whose type has a nullary constraint (i.e.: a constraint that does not reference any of the type variables in scope) and then try to run :t on it, GHCi attempts to run instance resolution and fails before printing the type.

Expected output:

GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help
Prelude> :set -XFlexibleContexts
Prelude> data Foo = Foo
Prelude> let x :: (Show Foo) => () ; x = ()
Prelude> :t x
x :: Show Foo => ()

Actual output:

GHCi, version 8.4.3: http://www.haskell.org/ghc/  :? for help
Prelude> :set -XFlexibleContexts
Prelude> data Foo = Foo
Prelude> let x :: (Show Foo) => () ; x = ()
Prelude> :t x

<interactive>:1:1: error:
    No instance for (Show Foo) arising from a use of ‘x’
Trac metadata
Trac field Value
Version 8.4.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
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