RE: Checking for WHNF (a horrible naughty thing)

2005-11-24 Thread Simon Marlow
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

Checking for WHNF (a horrible naughty thing)

2005-11-23 Thread Jan-Willem Maessen
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

Re: Checking for WHNF (a horrible naughty thing)

2005-11-23 Thread Sigbjorn Finne
@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