
12 Mar
2001
12 Mar
'01
4:38 a.m.
Hi,
I want to do something like:
| main = do | monstrousDataStructure <- monstrousComputation | hPutStr stderr "success!" | ...
The important point is that I want to make sure that the computation has terminated and not failed before I go to `...'. If the monstrous data structure has a 'serious' equality (not always returning True), you can try:
| main = do | monstrousDataStructure <- monstrousComputation | if (monstrousDataStructure == monstrousDataStructure) then | hPutStr stderr "success!" | else | hPutStr stderr "failure?" The idea is that comparing for equality walks over the entire data structure, forcing evaluation because every location has to be inspected. Hope this helps, Jan de Wit