[GHC] #13592: Newtype type class with compiler generated instances

GHC ghc-devs at haskell.org
Wed Apr 19 13:25:18 UTC 2017


#13592: Newtype type class with compiler generated instances
-------------------------------------+-------------------------------------
           Reporter:  Iceland_jack   |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.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:
-------------------------------------+-------------------------------------
 Define a `Newtype` class, autmatically generating instances

 {{{#!hs
 class Newtype n where
   type O n :: Type

   pack   :: O n -> n
   unpack :: n   -> O n
 }}}

 as defined in Conal's [http://conal.net/papers/generic-parallel-functional
 /generic-parallel-functional.pdf Generic parallel functional programming]
 but also found in the [https://hackage.haskell.org/package/newtype-0.2
 newtype] and [https://hackage.haskell.org/package/lens-4.15.1/docs
 /Control-Lens-Wrapped.html lens] packages.

 I run into this class every once in a while

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13592>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list