That strikes me as being bad in a "I'm violating the Halting Problem" sort of way- but I'm not sure how. Is there some contradictory construction that
could be built from such a function?

Nikhil Patil wrote:
Hi,
I am curious to know if there is a function in Haskell to find if a certain
value has already been evaluated. The function I need would have the type:

(?!) :: a -> Bool

And I expect it to be such that the following terminates after printing the
first 101 fibonacci numbers.

fibs = 0 : 1 : zipWith (+) fibs (tail fibs)

main = do print $ fibs !! 100
          print $ takeWhile (?!) fibs

Although I guess I can imagine the following not terminating:

          print $ filter (?!) fibs

I would find such a function immensely useful in "printing out" my infinite 
lists.

Thanks!

nikhil
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

begin:vcard
fn:Joseph Fredette
n:Fredette;Joseph
adr:Apartment #3;;6 Dean Street;Worcester;Massachusetts;01609;United States of America
email;internet:[email protected]
tel;home:1-508-966-9889
tel;cell:1-508-254-9901
x-mozilla-html:FALSE
url:lowlymath.net, humbuggery.net
version:2.1
end:vcard

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to