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,248
    • Issues 4,248
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 391
    • Merge Requests 391
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #14370

Closed
Open
Opened Oct 18, 2017 by Bertram Felgenhauer@int-eReporter

improve documentation of -fdefer-typed-holes for naked expressions in ghci

Consider the following ghci session.

GHCi, version 8.2.1: http://www.haskell.org/ghc/  :? for help
Prelude> :set -fdefer-typed-holes -Wno-typed-holes
Prelude> :set -fdefer-out-of-scope-variables -Wno-deferred-out-of-scope-variables
Prelude> let x = [_]; y = [r]
Prelude> (length x, length y)
(1,1)
Prelude> length [_]

<interactive>:4:9: error:
    • Found hole: _ :: a0
      Where: ‘a0’ is an ambiguous type variable
    • In the expression: _
      In the first argument of ‘length’, namely ‘[_]’
      In the expression: length [_]
    • Relevant bindings include it :: Int (bound at <interactive>:4:1)
Prelude> length [r]
1

Why does the length [_] expression produce a type error immediately instead of being deferred?

~~(I've asked the same question in #14367 (closed) but this looks like a real bug.)~~

The documentation can be improved here, see [#ticket:14370#comment:144137 comment 2]

Edited Mar 10, 2019 by Bertram Felgenhauer
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14370