On 23 November 2005 18:29, Sigbjorn Finne wrote:
The appended snippet might help..
--sigbjorn
-- whnf.hs
import Foreign.StablePtr
import System.IO.Unsafe
isWHNF :: a - Bool
isWHNF a = unsafePerformIO $ do
stl - newStablePtr a
rc - isWhnf stl
freeStablePtr stl
return
I would like to do a horrible naughty thing (which I promise never to
expose to the world). I would like to tell whether a term is in
WHNF, without forcing evaluation of that term. Something like:
isWHNF :: a - Bool
Is there a way of doing this? I can fake it with an IORef and much
@haskell.org
Sent: Wednesday, November 23, 2005 08:10
Subject: Checking for WHNF (a horrible naughty thing)
I would like to do a horrible naughty thing (which I promise never to
expose to the world). I would like to tell whether a term is in
WHNF, without forcing evaluation of that term. Something