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,250
    • Issues 5,250
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 576
    • Merge requests 576
  • 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
  • #15872
Closed
Open
Issue created Nov 07, 2018 by Icelandjack@IcelandjackReporter

Odd pretty printing of equality constraint in kind ('GHC.Types.Eq# <>)

Maybe indicative of deeper issues:

{-# Language RankNTypes #-}
{-# Language DataKinds  #-}
{-# Language PolyKinds  #-}
{-# Language GADTs      #-}

import Data.Kind

data WHICH = OP | OPOP

data Fun :: forall (a :: WHICH). a ~ OP => Type -> Type -> Type where
  MkFun :: (a -> b) -> Fun a b

There are some artifacts Fun ('GHC.Type.Eq# <>) in the type of MkFun that shouldn't be there

$ ~/code/unmodifiedghc/inplace/bin/ghc-stage2 --interactive -ignore-dot-ghci ~/hs/655_bug.hs
GHCi, version 8.7.20181029: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( /home/baldur/hs/655_bug.hs, interpreted )
Ok, one module loaded.
*Main> :t MkFun
MkFun :: (a -> b) -> Fun ('GHC.Types.Eq# <>) a b
*Main> :k Fun
Fun :: (a ~ 'OP) => * -> * -> *
*Main>

Tangent: Omitting {-# Language GADTs #-} we get the term "equational constraint" which is not the term I have seen in the wild

$ latestbug 655_bug.hs
GHCi, version 8.7.20181017: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( 655_bug.hs, interpreted )

655_bug.hs:9:1: error:
    Illegal equational constraint a ~ 'OP
    (Use GADTs or TypeFamilies to permit this)
  |
9 | data Fun :: forall (a :: WHICH). a ~ OP => Type -> Type -> Type where
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
Failed, no modules loaded.
Prelude>
Trac metadata
Trac field Value
Version 8.6.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking