Win32 non-backwards compatible API change

Tamar Christina tamar at
Fri Jan 27 12:53:21 UTC 2017

Hi All,

I want to revive and push forward a change first proposed in 2014 for an API
change in the Win32 package.

The discussion at that time took place here

In short, In the Windows API it is common that when a function accepts a pointer to something,
that NULL also be valid and defaults to some action. Such an example is the FindWindow call.

  _In_opt_ LPCTSTR lpClassName,
  _In_opt_ LPCTSTR lpWindowName

In this case, both the ClassName and the WindowName are allowed to be NULL.

The Haskell binding to this function is findWindow :: String -> String -> IO (Maybe HWND).
So we've lost the ability to use the default parameters.

The proposal is to change such functions to accept Maybe:

findWindow :: String -> String -> IO (Maybe HWND)


findWindow :: Maybe String -> Maybe String -> IO (Maybe HWND)

Which also would more accurately match the original API. This is of course a backwards incompatible change.

Any objections to this change?


More information about the Libraries mailing list