packages feed

deriving-via-fun 0.1.0.0 → 0.1.1.0

raw patch · 4 files changed

+17/−3 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- DerivingViaFun: data Fun1 (f :: p ~> q) (a :: k)
+ DerivingViaFun: Fun1 :: p a -> Fun1 (f :: p ~> q) (a :: k)
+ DerivingViaFun: newtype Fun1 (f :: p ~> q) (a :: k)

Files

CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for deriving-via-fun
 
-## 0.1.0.0 -- YYYY-mm-dd
+## 0.1.1.0 -- 2025-11-06
+
+- Export constructor of `Fun1`.
+
+## 0.1.0.0 -- 2025-11-06
 
 * First version. Released on an unsuspecting world.
deriving-via-fun.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0
 name:               deriving-via-fun
-version:            0.1.0.0
+version:            0.1.1.0
 synopsis: Deriving via first-class functions
 description:
   Derive class instances by mapping over them
src/DerivingViaFun.hs view
@@ -32,6 +32,10 @@ -- >   deriving (Semigroup, Monoid)
 -- >     via Fun (Coerce All Bool >>> Not >>> Coerce Bool Any)
 --
+-- > data T1 a = T1 [a] a
+-- >   deriving Generic
+-- >   deriving (Functor, Applicative, Monad, Foldable) via Fun1 (T1 ?-> Product [] Identity)
+--
 -- = Extensions to use this library
 --
 -- > {-# LANGUAGE DerivingVia, TypeOperators #-}
@@ -70,7 +74,7 @@   , Adhoc
 
   -- * Higher-kinded types
-  , Fun1
+  , Fun1(..)
   , fun1
   , unfun1
   , Apply1
test/Main.hs view
@@ -8,6 +8,8 @@ 
 import DerivingViaFun
 import Data.Monoid (Sum(..), Any(..))
+import Data.Functor.Product (Product(..))
+import Data.Functor.Identity (Identity(..))
 import GHC.Generics (Generic)
 
 data T0 = T0 Int Bool
@@ -18,6 +20,10 @@ newtype All = All Bool
   deriving (Eq, Ord) via Fun (Coerce All Bool)
   deriving (Semigroup, Monoid) via Fun (Coerce All Bool >>> Not >>> Coerce Bool Any)
+
+data T1 a = T1 [a] a
+  deriving Generic
+  deriving (Functor, Applicative, Monad, Foldable) via Fun1 (T1 ?-> Product [] Identity)
 
 main :: IO ()
 main = pure ()