
#14139: Kind signature -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.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: -------------------------------------+------------------------------------- I don't understand the rules for kind signatures / CUSKs but this works {{{#!hs import Data.Singletons.Prelude data Some (f :: u ~> v) where Some :: Sing (x :: u) -> f @@ x -> Some f }}} but this doesn't? {{{#!hs import Data.Kind import Data.Singletons.Prelude data Some :: (u ~> v) -> Type where Some :: Sing (x :: u) -> f @@ x -> Some f -- • Expected kind ‘u ~> v’, but ‘f’ has kind ‘u ~> *’ -- • In the first argument of ‘Some’, namely ‘f’ -- In the type ‘Some f’ -- In the definition of data constructor ‘Some’ -- | -- 5 | Some :: Sing (x :: u) -> f @@ x -> Some f -- | ^ -- Failed, modules loaded: none. }}} I have to quantify over them for it to work `forall u v. (u ~> v) -> Type`, if this is expected I feel like the error message ought to be improved. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14139 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14139: Kind signature not accepted (singletons) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: TypeInType 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 Iceland_jack): * keywords: => TypeInType -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14139#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14139: Kind signature not accepted (singletons) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: duplicate | Keywords: TypeInType Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13365 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * related: => #13365 Comment: Yep, this is a CUSK issue. [http://git.haskell.org/ghc.git/blob/1cdceb9fa3bc3ad01b2d840caad8e735513e14ed... Here] is the relevant section of the users' guide: {{{ - For a datatype with a top-level ``::`` when :ghc-flag:`-XTypeInType` is in effect: all kind variables introduced after the ``::`` must be explicitly quantified. :: -- -XTypeInType is on data T1 :: k -> * -- No CUSK: `k` is not explicitly quantified data T2 :: forall k. k -> * -- CUSK: `k` is bound explicitly data T3 :: forall (k :: *). k -> * -- still a CUSK Note that the first example would indeed have a CUSK without :ghc-flag:`-XTypeInType`. }}} In your example, `v` is not explicitly quantified in the kind signature of `Some`, which explains why its kind defaults to `*` (and results in the error message you see). Since this asks to improve the error message to warn about CUSK behavior, I'll close this as a duplicate of #13365, which seeks the same goal. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14139#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14139: Kind signature not accepted (singletons) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: duplicate | Keywords: TypeInType, | CUSKs Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13365 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * keywords: TypeInType => TypeInType, CUSKs -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14139#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14139: Kind signature not accepted (singletons) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: duplicate | Keywords: TypeInType, | CUSKs Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #13365 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Thanks!! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14139#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC