<div dir="auto">As painful as the transition might be, we desperately need to set this right sooner rather than later. The number of libraries depending on win32 is not going to decrease over time.<div dir="auto"><br></div><div dir="auto">+1</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Jan 27, 2017 7:54 AM, "Tamar Christina" <<a href="mailto:tamar@zhox.com">tamar@zhox.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi All,<br>
<br>
I want to revive and push forward a change first proposed in 2014 for an API<br>
change in the Win32 package.<br>
<br>
The discussion at that time took place here <a href="https://github.com/haskell/win32/issues/24" rel="noreferrer" target="_blank">https://github.com/haskell/<wbr>win32/issues/24</a><br>
<br>
In short, In the Windows API it is common that when a function accepts a pointer to something,<br>
that NULL also be valid and defaults to some action. Such an example is the FindWindow call.<br>
<br>
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms633499(v=vs.85).aspx" rel="noreferrer" target="_blank">https://msdn.microsoft.com/en-<wbr>us/library/windows/desktop/<wbr>ms633499(v=vs.85).aspx</a><br>
<br>
HWND WINAPI FindWindow(<br>
  _In_opt_ LPCTSTR lpClassName,<br>
  _In_opt_ LPCTSTR lpWindowName<br>
);<br>
<br>
In this case, both the ClassName and the WindowName are allowed to be NULL.<br>
<br>
The Haskell binding to this function is findWindow :: String -> String -> IO (Maybe HWND).<br>
So we've lost the ability to use the default parameters.<br>
<br>
The proposal is to change such functions to accept Maybe:<br>
<br>
findWindow :: String -> String -> IO (Maybe HWND)<br>
<br>
becomes<br>
<br>
findWindow :: Maybe String -> Maybe String -> IO (Maybe HWND)<br>
<br>
Which also would more accurately match the original API. This is of course a backwards incompatible change.<br>
<br>
Any objections to this change?<br>
<br>
Thanks,<br>
Tamar<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org">Libraries@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/libraries</a><br>
</blockquote></div></div>