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

flip setField arguments to match -XOverloadedRecordUpdate desugaring #162

Open
aavogt opened this issue Apr 14, 2024 · 1 comment
Open

Comments

@aavogt
Copy link

aavogt commented Apr 14, 2024

At least in ghc 9.8, -XOverloadedRecordUpdate needs a flipped setField. I have to define:

{-# LANGUAGE ScopedTypeVariables, TypeApplications, AllowAmbiguousTypes #-}
setField :: forall f s a. (HasField' f s a) => s -> a -> s
setField a b = Data.Generics.Product.setField @f b a

I like your order better, but it's easier to deal with a change in a library than a change in ghc.

@adamgundry
Copy link

There's actually a plan to change this in GHC, so it may be better to hold off adjusting generic-lens:

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