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,248
    • Issues 4,248
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 397
    • Merge Requests 397
  • 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
  • #14943

Closed
Open
Opened Mar 19, 2018 by Icelandjack@IcelandjackReporter

Make (=>) polykinded (:: k -> k -> Constraint)

Would it be a good idea to treat => in -XQuantifiedConstraints as

type family
  (=>) :: k -> k -> Constraint where
  (=>) = Implies0
  (=>) = Implies1
  (=>) = Implies2 ..
class    (a => b) => Implies a b
instance (a => b) => Implies a b

class    (forall x. f x => g x) => Implies1 f g
instance (forall x. f x => g x) => Implies1 f g

class    (forall x y. f x y => g x y) => Implies2 f g
instance (forall x y. f x y => g x y) => Implies2 f g
..

or will this get too confusing? This means type signatures like the ones from #14942 (closed)

oneTwo   :: (forall x. semi x => Semigroup x) => Free semi Int

nil      :: (forall x. mon  x => Monoid x)    => Free mon Int

together :: (forall x. mon  x => Monoid x)    => [Free mon Int]

could equivalently be written

oneTwo   :: (semi => Semigroup) => Free semi Int

nil      :: (mon  => Monoid)    => Free mon Int

together :: (mon  => Monoid)    => [Free mon Int]

I'm not sold on this idea myself. It's quite possible this would screw with the parser.

Trac metadata
Trac field Value
Version 8.2.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#14943