[darcs-users] darcs patch: clean up types in win32/System/Posix.hs
kirby81 at gmail.com
Sat Sep 26 19:21:26 UTC 2009
On Sat, Sep 26, 2009 at 7:27 PM, Eric Kow <kowey at darcs.net> wrote:
> This was lying around. Trent sent it in May.
> Could somebody have a look?
This patch it just removing some low-level code, replacing it with
more type-safe high-level one.
withArray converts a list of Storable into a C-like array of values,
and that's exactly what the previous allocaBytes / poke stuff did.
alloca and allocBytes do exactly the same thing, but alloca can infer
automatically the right pointer size if the value pointed to is
Storable (and CTTime is).
I don't even think that the type annotation ":: IO CTime" is
necessary, as the type of p is bound from the c_ctime call.
I think this is pretty safe to apply.
More information about the darcs-users