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

Consolidate CodePage in System.Win32.NLS with the CodePage in base-4.15 #169

Closed
RyanGlScott opened this issue Feb 6, 2021 · 3 comments · Fixed by #170
Closed

Consolidate CodePage in System.Win32.NLS with the CodePage in base-4.15 #169

RyanGlScott opened this issue Feb 6, 2021 · 3 comments · Fixed by #170

Comments

@RyanGlScott
Copy link
Member

Both Win32 and base-4.15 define identical (but distinct) type synonyms named CodePage. I propose that Win32 re-export the CodePage from base when possible.

Current Behavior

As of base-4.15, the GHC.IO.Encoding.CodePage module defines a type synonym named CodePage:

type CodePage = DWORD

As it turns out, the Win32 library also defines an identical (but distinct) type synonym named CodePage in System.Win32.NLS:

type CodePage = UINT

(Note that DWORD = UINT = Word32.) This creates problems for code that tries to use both System.Win32.NLS and GHC.IO.Encoding.CodePage together, as their two CodePage definitions will clash.

Steps to Reproduce (for bugs)

An example of a library that this actually affected in practice in code-page, which stopped building after base-4.15's release. See RyanGlScott/code-page#5. It's possible to work around the issue, but if Win32 simply re-exported CodePage from base, this bug would have never happened in the first place.

Your Environment

  • Version used: GHC 9.0.1 (base-4.15.0.0 and Win32-2.10.0.0)
  • Operating System and version: 64-bit Windows 10
@RyanGlScott
Copy link
Member Author

#170 implements this idea.

@Mistuke
Copy link
Contributor

Mistuke commented Feb 6, 2021

Thanks for the issue and PR @RyanGlScott, do you need a release before the scheduled monthly one?

@RyanGlScott
Copy link
Member Author

Thanks! And I'm not in a hurry to get this released to Hackage, so the current release schedule is fine.

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

Successfully merging a pull request may close this issue.

2 participants