haskell / win32

Haskell support for the Win32 API
http://hackage.haskell.org/package/Win32
Other
97 stars 63 forks source link

Clarify the decision behind the HWND/HANDLE/Ptr() type synonyms #44

Open expipiplus1 opened 8 years ago

expipiplus1 commented 8 years ago

I was surprised to find that these aren't the definitions for HWND and HANDLE

newtype HWND = HWND { unsafeHWNDToHANDLE :: HANDLE }

newtype HANDLE = HANDLE { unsafeHANDLEToPtr :: Ptr () }

I'm not an expert in Win32 programming, but I don't think that conversions between these three types are so pervasive (and without consequence) as to necessitate using synonyms here rather than something which protects the programmer a little more. If this is required, it would be great to document the declarations with this information, if not then perhaps there could be a major version update replacing the synonyms.

The same thing could probably be said for any of the other type synonyms of HANDLE in Win32.