
28 Oct
2010
28 Oct
'10
7:55 a.m.
On 27/10/2010 08:43, Simon Peyton-Jones wrote:
| Users of the sizeOf or alignment methods (:: a -> Int) of the Storable | class are pushed to use 'undefined' in their programs. Take the | following function from Foreign.Marshal.Alloc as an example: | | malloc :: Storable a => IO (Ptr a) | malloc = doMalloc undefined | where | doMalloc :: Storable b => b -> IO (Ptr b) | doMalloc dummy = mallocBytes (sizeOf dummy) | ... | | I would like to propose solving this. My proposal consists of 3 sub-proposals:
I'm not keen on this proposal. a) The improvement is minor b) A lot of exixting code has to be changed c) There is a better way to do the job
Agree. Simon