newtype

A typeclass and set of functions for working with newtypes.

LTS Haskell 24.25:0.2.2.0@rev:3
Stackage Nightly 2025-12-26:0.2.2.1
Latest on Hackage:0.2.2.1

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-0.2.2.1@sha256:43a08f1b02b18945a958510573494cd7f6da66dec3c0b463a212f2a37d636882,1377

Module documentation for 0.2.2.1

Depends on 1 package(full list with versions):
Used by 2 packages in nightly-2025-12-26(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.

Changes

0.2.2.1

  • Drop support for GHC 7.
  • Tested with GHC 8.0 - 9.14.

0.2.2.0

  • Provide safe coerceible based default-methods for pack/unpack

0.2.1.0 (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