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,244
    • Issues 5,244
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 571
    • Merge requests 571
  • 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
  • #16596
Closed
Open
Issue created Apr 20, 2019 by Icelandjack@IcelandjackReporter

Can't write instances of higher-rank kinded variables

{-# language PolyKinds             #-}
{-# language QuantifiedConstraints #-}
{-# language RankNTypes            #-}

import Data.Kind (Type)

class    C (co :: forall k. k -> Type)
instance C (co :: forall k. k -> Type)

gives

$ ./ghc-stage2 --interactive -ignore-dot-ghci 1260_bug.hs
GHCi, version 8.7.20190211: https://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( 1260_bug.hs, interpreted )

1260_bug.hs:8:13: error:
    • Expected kind ‘forall k. k -> *’, but ‘co’ has kind ‘k0’
    • In the first argument of ‘C’, namely
        ‘(co :: forall k. k -> Type)’
      In the instance declaration for ‘C (co :: forall k. k -> Type)’
  |
8 | instance C (co :: forall k. k -> Type)
  |             ^^
Failed, no modules loaded.
Prelude>

Only the instance part causes trouble, should this work or not?

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking