Open lingnand opened 6 years ago
How would you write pNewtype :: (Profunctor p, Newtype t) => p a b -> p (t a) (t b)
in terms of Control.Newtype
?
I imagine something along the line of
pNewtype :: (Profunctor p, Newtype n1 o1, Newtype n2 o2) => p o1 o2 -> p n1 n2
pNewtype = dimap unpack pack
And maybe another version allowing passing in type witnesses via Newtype constructors.
Haven't tested these though.
It seems like the
Newtype
class in this package can be entirely replaced by using the more widely usedControl.Newtype
class - or maybe I'm missing something?