newtype-generics 0.4.1 → 0.4.2
raw patch · 2 files changed
+8/−7 lines, 2 filesdep ~HUnitdep ~basedep ~hspecPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: HUnit, base, hspec
API changes (from Hackage documentation)
- Control.Newtype: instance GNewtype (D1 d (C1 c (S1 s (K1 i a))))
- Control.Newtype: instance Newtype (ArrowMonad a b)
- Control.Newtype: instance Newtype (Const a x)
- Control.Newtype: instance Newtype (Endo a)
- Control.Newtype: instance Newtype (First a)
- Control.Newtype: instance Newtype (Kleisli m a b)
- Control.Newtype: instance Newtype (Last a)
- Control.Newtype: instance Newtype (Product a)
- Control.Newtype: instance Newtype (Sum a)
- Control.Newtype: instance Newtype (WrappedArrow a b c)
- Control.Newtype: instance Newtype (WrappedMonad m a)
- Control.Newtype: instance Newtype (ZipList a)
- Control.Newtype: instance Newtype All
- Control.Newtype: instance Newtype Any
+ Control.Newtype: instance Control.Newtype.GNewtype (GHC.Generics.D1 d (GHC.Generics.C1 c (GHC.Generics.S1 s (GHC.Generics.K1 i a))))
+ Control.Newtype: instance Control.Newtype.Newtype (Control.Applicative.WrappedArrow a b c)
+ Control.Newtype: instance Control.Newtype.Newtype (Control.Applicative.WrappedMonad m a)
+ Control.Newtype: instance Control.Newtype.Newtype (Control.Applicative.ZipList a)
+ Control.Newtype: instance Control.Newtype.Newtype (Control.Arrow.ArrowMonad a b)
+ Control.Newtype: instance Control.Newtype.Newtype (Control.Arrow.Kleisli m a b)
+ Control.Newtype: instance Control.Newtype.Newtype (Data.Functor.Const.Const a x)
+ Control.Newtype: instance Control.Newtype.Newtype (Data.Monoid.Endo a)
+ Control.Newtype: instance Control.Newtype.Newtype (Data.Monoid.First a)
+ Control.Newtype: instance Control.Newtype.Newtype (Data.Monoid.Last a)
+ Control.Newtype: instance Control.Newtype.Newtype (Data.Monoid.Product a)
+ Control.Newtype: instance Control.Newtype.Newtype (Data.Monoid.Sum a)
+ Control.Newtype: instance Control.Newtype.Newtype Data.Monoid.All
+ Control.Newtype: instance Control.Newtype.Newtype Data.Monoid.Any
+ Control.Newtype: type O n = GO (Rep n);
+ Control.Newtype: type family O n :: *;
+ Control.Newtype: }
- Control.Newtype: class Newtype n where type family O n :: * type instance O n = GO (Rep n) pack = to . gpack unpack = gunpack . from
+ Control.Newtype: class Newtype n where type O n :: * type O n = GO (Rep n) pack = to . gpack unpack = gunpack . from where {
- Control.Newtype: pack :: Newtype n => O n -> n
+ Control.Newtype: pack :: (Newtype n, Generic n, GNewtype (Rep n), O n ~ GO (Rep n)) => O n -> n
- Control.Newtype: unpack :: Newtype n => n -> O n
+ Control.Newtype: unpack :: (Newtype n, Generic n, GNewtype (Rep n), O n ~ GO (Rep n)) => n -> O n
Files
- Control/Newtype.hs +3/−2
- newtype-generics.cabal +5/−5
Control/Newtype.hs view
@@ -24,11 +24,12 @@ For example, see @ala Cont traverse@, with the proper 'Newtype' instance for Cont. You can easily define new instances for your newtypes with the help of GHC.Generics - > {—# LANGUAGE DeriveGeneric #—}+ > {-# LANGUAGE DeriveGeneric #-} > import GHC.Generics > > (...)- > newtype Example = Example Int {deriving Generic)+ > newtype Example = Example Int + > deriving (Generic) > > instance Newtype Example >
newtype-generics.cabal view
@@ -1,5 +1,5 @@ Name: newtype-generics-Version: 0.4.1+Version: 0.4.2 Synopsis: A typeclass and set of functions for working with newtypes, with generics support. Description: Per Conor McBride, the Newtype typeclass represents the packing and unpacking of a newtype, and allows you to operatate under that newtype with functions such as ala.@@ -17,7 +17,7 @@ Library Exposed-modules: Control.Newtype- Build-depends: base >= 4.5 && < 4.9+ Build-depends: base >= 4.6 && < 4.10 -- Other-modules: -- Build-tools: Ghc-options: -Wall@@ -31,7 +31,7 @@ type: exitcode-stdio-1.0 main-is: main.hs hs-source-dirs: test,.- build-depends: base >= 4.5 && < 4.9- , hspec >= 2.1 && < 2.3- , HUnit >= 1.2.5.2 && < 1.3+ build-depends: base+ , hspec >= 2.1 && < 2.4+ , HUnit >= 1.2.5.2 && < 1.6 default-language: Haskell2010