Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Control.Newtype from newtype #47

Open
lingnand opened this issue Jul 12, 2018 · 2 comments
Open

Use Control.Newtype from newtype #47

lingnand opened this issue Jul 12, 2018 · 2 comments

Comments

@lingnand
Copy link

lingnand commented Jul 12, 2018

It seems like the Newtype class in this package can be entirely replaced by using the more widely used Control.Newtype class - or maybe I'm missing something?

@tomjaguarpaw
Copy link
Owner

How would you write pNewtype :: (Profunctor p, Newtype t) => p a b -> p (t a) (t b) in terms of Control.Newtype?

@lingnand
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants