Jacques Carette wrote: > Bulat Ziganshin wrote: > > >malloc :: Storable a => IO (Ptr a) > >malloc = doMalloc undefined > > where > > doMalloc :: Storable b => b -> IO (Ptr b) > > doMalloc dummy = mallocBytes (sizeOf dummy) > > > > > Is there any reason to not code this as > > malloc :: Storable a => IO (Ptr a) > malloc = mallocBytes $ sizeof undefined > ?
There is. Don't you think there's a reason why doMalloc above has an explicit type signature? What would happen if you deleted it? Udo. -- "You, sir, are nothing but a pathetically lame salesdroid! I fart in your general direction!" -- Randseed on #Linux
signature.asc
Description: Digital signature
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe