[email protected]
[Top] [All Lists]

Re: [Haskell-cafe] sizeOf on a type

Subject: Re: [Haskell-cafe] sizeOf on a type
From: Henning Thielemann
Date: Thu, 14 Jan 2010 18:51:55 +0100 CET
On Fri, 25 Dec 2009, Lennart Augustsson wrote:

sizeOfPtr :: Ptr a -> Int
sizeOfPtr = sizeOf . (undefined :: Ptr a -> a)

No need for scoped type variables.  But it does assume sizeOf does not
use its argument.
That's even better. I'll add that to the Wiki.

Haskell-Cafe mailing list
[email protected]
<Prev in Thread] Current Thread [Next in Thread>