[GHC] #14943: Make (=>) polykinded (:: k -> k -> Constraint)

#14943: Make (=>) polykinded (:: k -> k -> Constraint) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Keywords: | Operating System: Unknown/Multiple QuantifiedConstraints, wipT2893 | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Would it be a good idea to treat `=>` in `-XQuantifiedConstraints` as {{{#!hs type family (=>) :: k -> k -> Constraint where (=>) = Implies0 (=>) = Implies1 (=>) = Implies2 .. }}} {{{#!hs 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 {{{#!hs 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 {{{#!hs 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14943 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14943: Make (=>) polykinded (:: k -> k -> Constraint) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: | QuantifiedConstraints, wipT2893 Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by RyanGlScott): Yeah... I'm certainly not convinced this is a good idea. This seems needlessly magical, and moreover, oddly asymmetric with the typing rule for `(->)`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14943#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14943: Make (=>) polykinded (:: k -> k -> Constraint) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: | QuantifiedConstraints, wipT2893 Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): No, I don't see a need for this. You could always define such an infix type family yourself, couldn't you? Then you wouldn't need to mess with built-in syntax. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14943#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14943: Make (=>) polykinded (:: k -> k -> Constraint) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.2 Resolution: | Keywords: | QuantifiedConstraints Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: QuantifiedConstraints, wipT2893 => QuantifiedConstraints -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14943#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC