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

add newtype props #31

wants to merge 1 commit into from


None yet
3 participants
Copy link

commented Sep 20, 2017

This may or may not be desired, but it's what I use so I thought it might be worth PR'ing

If codegen creates some newtypes, this will add lens accessors with newtype unwrapping for those types.


newtype Thing = Thing { a :: String, b :: Int }
deriving instance newtype thingNewtype :: Newtype Thing _
_a = _Newtype <<< prop (SProxy :: SProxy "a")
_b = _Newtype <<< prop (SProxy :: SProxy "b")

@eskimor eskimor added the enhancement label Sep 22, 2017


This comment has been minimized.

Copy link

commented Sep 22, 2017

Thank you! I don't really know what this Newtype thing is (haven't used PS in a while), I have to check this out first.


This comment has been minimized.

Copy link

commented Oct 9, 2017

This looks really good. As I mentioned on the other PR - do you think it's worth converting all the generated record lenses to use prop now?


This comment has been minimized.

Copy link

commented Oct 9, 2017

It does require more imports which is probably not desirable. I'm closing this in favor of #32 for now

@tippenein tippenein closed this Oct 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.