module Data.Profunctor.Product.Newtype where

import qualified Data.Profunctor as P

class Newtype t where
  constructor :: a -> t a
  field       :: t a -> a

pNewtype :: (P.Profunctor p, Newtype t) => p a b -> p (t a) (t b)
pNewtype :: forall (p :: * -> * -> *) (t :: * -> *) a b.
(Profunctor p, Newtype t) =>
p a b -> p (t a) (t b)
pNewtype = forall (p :: * -> * -> *) a b c d.
Profunctor p =>
(a -> b) -> (c -> d) -> p b c -> p a d
P.dimap forall (t :: * -> *) a. Newtype t => t a -> a
field forall (t :: * -> *) a. Newtype t => a -> t a
constructor