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
  • #11620
Closed
Open
Issue created Feb 21, 2016 by Icelandjack@IcelandjackReporter

RFC: Type-class type signatures (:: Constraint)

Data types can be defined:

data A a b
-- or
data A (a :: Bool) (b :: Type)
-- or
data A (a :: Bool) (b :: Type) :: Type
-- or
data A :: Bool -> Type -> Type

data B :: Type

while type classes can't:

class A a b
-- or
class A (a :: Bool) (b :: Type)
-- but not
-- class A (a :: Bool) (b :: Type) :: Constraint
-- nor
-- class A :: Bool -> Type -> Constraint

-- class B :: Constraint

I foresee problems with how to bind a and b, but adding a final :: Constraint should be legal:

class A a b :: Constraint

class A (a :: Bool) (b :: Type) :: Constraint

class B :: Constraint
Trac metadata
Trac field Value
Version 8.1
Type FeatureRequest
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