[Haskell-cafe] Newbie: Is it possible to catch _|_ ?

Ketil Malde ketil+haskell at ii.uib.no
Wed Apr 7 09:12:52 EDT 2004

"Russ Lewis" <spamhole-2001-07-16 at deming-os.org> writes:

> Oh.  I was figuring that the runtime would detect _|_ whenever
> evaluation requires that it calculate a given expressoin, and that
> expression is currently being evaluated...that is, some subset of an
> expression evaluates to the expression itself.

You mean like in
        fibs = 1:1:zipWith (+) fibs (tail fibs)
? :-)

Actually, (and more seriously) I suspect this is the kind of loop
detection that makes GHC go "Exception: loop" (which you may be able to
catch; I don't know the details since I just let my programs crash
instead :-)

        Prelude> let x = x
        Prelude> x
        *** Exception: <<loop>>

If I haven't seen further, it is by standing in the footprints of giants

More information about the Haskell-Cafe mailing list