Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Testing for congruence in Haskell

Name: Anonymous 2008-12-06 14:08

Hello /prog/ Haskell programers users. Is it possible to test for the congruence of expression in Haskell? I know i can say
this a = if (a 12) == 12 then (a 12) else (a 13)
and expect this (\ x -> x + 1) to eval to 14. But is there anyway to test for the equivalence of two (or more) expressons without actually applying either of them? In other words, can haskell do anything with thunks, aide from than apply them?

(\ x -> x) == (\ x -> x) is not an expression. Is there a corrext syntax for this type of thing?
Thanks,

Name: Anonymous 2008-12-06 15:50

>>5
Since there is no way (in general) to know what a program will output without actually running it there is no way to tell if two programs are equivalent.
Sure, maybe we can't know for sure, but we can make a pretty good guess. If we see a "for" loops that runs 100,000 times, there's a good chance that the program is in an infinite loop.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List