[GHC] #11622: Annotating types in type familiy equations without parentheses
#11622: Annotating types in type familiy equations without parentheses -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- When annotating types in right-hand side of type family equations parentheses are required: {{{#!hs type family F a where F _ = (Int :: Type) }}} instead of {{{#!hs type family F a where F _ = Int :: Type }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11622> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11622: Annotating types in type familiy equations without parentheses -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: 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): Parentheses are always required around kind annotations. This has been reported in the last six months, but, sadly, a few minutes of searching has not found the ticket number. I believe this would just require a careful look at the parser -- there may not be a fundamental reason for the restriction. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11622#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11622: Annotating types in type familiy equations without parentheses -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: 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 Iceland_jack): Were you thinking of #8708? Removing this restriction would help make the `:kind` command less surprising: {{{
:kind Int Int :: * :kind Int :: * <parse error> }}}
where one might expect it to work like {{{
:type 'a' 'a' :: Char :type 'a' :: Char 'a' :: Char :: Char }}}
While we're at it, is it possible to automatically quantify free variables? {{{
:kind Maybe Maybe :: * -> * :kind Maybe a <not-in-scope error> }}}
Explicitly quantifying the variables gets tiresome when there are more of them -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11622#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11622: Annotating types in type familiy equations without parentheses -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: 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 simonpj): This can't be hard; just some careful work in the parser. Any volunteers? Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11622#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11622: Annotating types in type familiy equations without parentheses -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5173 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D5173 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11622#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11622: Annotating types in type familiy equations without parentheses -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 8.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5173 Wiki Page: | -------------------------------------+------------------------------------- Comment (by Ryan Scott <ryan.gl.scott@…>): In [changeset:"bace26aadaafa4064e78f9ed088c1e2217221acc/ghc" bace26a/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="bace26aadaafa4064e78f9ed088c1e2217221acc" Allow (unparenthesized) kind signatures Summary: This allows for things like `[t :: MyKind]`, `(a :: k, b)`, and so on. Test Plan: make TEST=T11622 && make TEST=T8708 Reviewers: RyanGlScott, bgamari, simonpj, goldfire, alanz Reviewed By: RyanGlScott, simonpj Subscribers: alanz, simonpj, rwbarton, mpickering, carter GHC Trac Issues: #11622, #8708 Differential Revision: https://phabricator.haskell.org/D5173 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11622#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#11622: Annotating types in type familiy equations without parentheses -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_compile/T11622 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5173 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * testcase: => parser/should_compile/T11622 * status: patch => closed * resolution: => fixed * milestone: => 8.8.1 -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11622#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC