A typeclass and set of functions for working with newtypes.

LTS Haskell 22.25:
Stackage Nightly 2024-06-13:
Latest on Hackage:

See all snapshots newtype appears in

BSD-3-Clause licensed by Herbert Valerio Riedel, Darius Jahandarie, Conor McBride
Maintained by Andreas Abel
This version can be pinned in stack with:newtype-,1559

Module documentation for

Depends on 1 package(full list with versions):

Per Conor McBride, the Newtype typeclass represents the packing and unpacking of a newtype, and allows you to operate under that newtype with functions such as ala. See Control.Newtype for documentation and examples.


See also (minor)

  • Provide safe Coercible-based default-methods for pack/unpack (#1) (minor)

  • Added Newtype instances for
    • Data.Fixed.Fixed
    • Data.Functor.Compose.Compose
    • Data.Functor.Identity.Identity
    • Data.Monoid.Alt
    • Data.Monoid.Ap
    • Data.Monoid.Dual
    • Data.Ord.Down
  • Declare Control.Newtype explicitly as Trustworthy under SafeHaskell