
#12369: data families shouldn't be required to have return kind *, data instances should -------------------------------------+------------------------------------- Reporter: ekmett | Owner: Type: feature request | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.0.1 checker) | 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): Replying to [comment:5 Iceland_jack]:
The part about **runtime representation** made me wonder if you could
define
{{{#!hs -- × × × FAILS × × × data family Array a :: TYPE rep }}}
I dunno about the instances, maybe using
[https://ghc.haskell.org/trac/ghc/wiki/UnliftedDataTypes#Proposal3:Allownewty... Proposal 3: Allow newtypes over unlifted types] While there's nothing very wrong about the data family definition, the instances would be a problem, because we don't yet have a way to make user-written unlifted types. It would indeed be useful to have this, but we don't. So I think this kind of construct is best off waiting until we solve the simpler case of normal unlifted datatypes before we try unlifted data families.
----
{{{#!hs -- WORKS FINE data family Array (a :: TYPE rep) :: Type
-- × × × FAILS × × × -- -- Unexpected type ‘Int#’ data Array Int# -- Should this fail? }}}
You just want to say `data instance Array Int#`, which indeed works fine. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12369#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler