[GHC] #11636: Promoting newtype destructor

#11636: Promoting newtype destructor -------------------------------------+------------------------------------- Reporter: phadej | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 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: -------------------------------------+------------------------------------- given {{{ newtype LOL a = MkLOL { unLOL :: [[a]] } }}} I'd like to write {{{ type family UnLOL (lol :: LOL a) = (result :: [[a]]) | result -> lol type instance UnLOL ('MkLOL xss) = xss }}} This is currently not accepted, but AFAICS it should be injective, as `lol` is kind restricted. Especially the example in injective type families paper do not apply, as `UnLOL Int` is ill-kinded. With this GHC could infer `lol ~ MkLOL xss` from `UnLOL lol ~ xss`, so newtypes would be useful for type-level programming, as type (kind) synonyms cannot be partially applied. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11636 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11636: Promoting newtype destructor -------------------------------------+------------------------------------- Reporter: phadej | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 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: | -------------------------------------+------------------------------------- Changes (by jstolarek): * cc: jstolarek (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11636#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC