Skip to content
GitLab
Projects Groups Snippets
  • /
  • 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 5,242
    • Issues 5,242
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 566
    • Merge requests 566
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #12569
Closed
Open
Issue created Sep 04, 2016 by Alexey Vagarenko@vagarenkoReporter

TypeApplications allows instantiation of implicitly-quantified kind variables

TypeApplications doesn't allow unticked list constructor even when it is unambiguous:

GHCi, version 8.0.1: http://www.haskell.org/ghc/  :? for help
> :set -XDataKinds
> :set -XTypeApplications
> :set -XScopedTypeVariables
> :set -XKindSignatures
> let foo :: forall (xs :: [Nat]). (); foo = ()
> foo @'[0]
()
> foo @[0]

<interactive>:17:6: error:
    * Expected kind `[Nat]', but `[0]' has kind `*'
    * In the type `[0]'
      In the expression: foo @[0]
      In an equation for `it': it = foo @[0]

<interactive>:17:7: error:
    * Expected a type, but `0' has kind `Nat'
    * In the type `[0]'
      In the expression: foo @[0]
      In an equation for `it': it = foo @[0]

why [0] has kind * here?

However this is legal:

> let foo :: forall (x :: Bool). (); foo = ()
> foo @True
()
> foo @'True
()

and this is wierd:

> :set -XPolyKinds
> let foo :: forall (x :: k). (); foo = ()
> foo @'True

<interactive>:12:6: error:
    * Expected a type, but 'True has kind `Bool'
    * In the type `True'
      In the expression: foo @True
      In an equation for `it': it = foo @True
> foo @True

<interactive>:13:6: error:
    * Expected a type, but 'True has kind `Bool'
    * In the type `True'
      In the expression: foo @True
      In an equation for `it': it = foo @True
Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited Mar 10, 2019 by Adam Gundry
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking