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,321
    • Issues 4,321
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 359
    • Merge Requests 359
  • 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
  • #16421

Closed
Open
Opened Mar 11, 2019 by Ryan Scott@RyanGlScottMaintainer

Named wildcards require PartialTypeSignatures in visible kind applications, but not type applications

The following program typechecks:

{-# LANGUAGE NamedWildCards #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeApplications #-}
module Bug where

data P (a :: k) = MkP

f :: P Int
f = MkP @_k

However, if I use a named wildcard in a visible //kind// application, such as in the following variant of f:

g :: P @_k Int
g = MkP

Then GHC errors unless I enable PartialTypeSignatures:

$ ~/Software/ghc5/inplace/bin/ghc-stage2 Bug.hs
[1 of 1] Compiling Bug              ( Bug.hs, Bug.o )

Bug.hs:11:9: error:
    • Found type wildcard ‘_k’ standing for ‘*’
      To use the inferred type, enable PartialTypeSignatures
    • In the type signature: g :: P @_k Int
   |
11 | g :: P @_k Int
   |         ^^

It feels strangely inconsistent to require the language extension in one place but not the other.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#16421