Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,394
    • Issues 4,394
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 374
    • Merge Requests 374
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #675

Closed
Open
Opened Jan 28, 2006 by guest@trac-guest

Bad error message in GHCi

If

import Test.QuickCheck

prop_eq_reflexive x = x == x

is loaded into GHCi the following can be observed:

*BadErrorMessage> quickCheck prop_eq_reflexive

Top level:
    No instance for (Show (IO ()))
      arising from use of `print' at Top level
    Probable fix: add an instance declaration for (Show (IO ()))
    In a 'do' expression: print it

Hugs gives the more understandable error message

BadErrorMessage> quickCheck prop_eq_reflexive
ERROR - Unresolved overloading
*** Type       : (Eq a, Show a, Arbitrary a) => IO ()
*** Expression : quickCheck prop_eq_reflexive

:t in GHCi gives an even more understandable error message:

*BadErrorMessage> :t quickCheck prop_eq_reflexive

<interactive>:1:0:
    Ambiguous type variable `a' in the constraints:
      `Arbitrary a' arising from use of `quickCheck' at <interactive>:1:0-9
      `Eq a' arising from use of `prop_eq_reflexive' at <interactive>:1:11-27
      `Show a' arising from use of `quickCheck' at <interactive>:1:0-9
    Probable fix: add a type signature that fixes these type variable(s)

(In the introductory FP courses at Chalmers we use Quick``Check from the start, so this error message bites students in the first week.)

Trac metadata
Trac field Value
Version 6.4.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#675