Opened 3 years ago

Closed 2 years ago

#12089 closed bug (duplicate)

:kind command allows unsaturated type family,

Reported by: Iceland_jack Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.0.1
Keywords: TypeFamilies Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #13962 Differential Rev(s):
Wiki Page:

Description

data A = B

type family
  F a where
  F B = String

infixr 9 `Compose`
class    (f (g x)) => (f `Compose` g) x
instance (f (g x)) => (f `Compose` g) x

GHCi accepts

ghci> :kind Compose Eq F
Compose Eq F :: A -> Constraint

but when used in code it gets rejected

-- tvI6.hs:13:8-33: error: …
--     • The type family ‘F’ should have 1 argument, but has been given none
--     • In the type signature:
--         foo :: (Eq `Compose` F) a => String
-- Compilation failed.
foo :: (Eq`Compose`F) a => String
foo = undefined 

Bug? Version 8.0.0.20160511

Change History (1)

comment:1 Changed 2 years ago by RyanGlScott

Keywords: TypeFamilies added
Resolution: duplicate
Status: newclosed

Although this is the older ticket, I'll opt to close this in favor of #13962, since I find #13962 to be a cleaner example.

Note: See TracTickets for help on using tickets.