[PRL] circular haskell programs

Dave Herman dherman at ccs.neu.edu
Thu Jun 30 13:25:57 EDT 2005


>>You use co-induction. -- Matthias
> 
> Sure, but how do you intuit the existence 
> of that greatest fixed point?

Thank you-- I think that's really my question. For example, we don't 
expect a useful answer from this program:

     data Thing = Leaf
                | Node Thing

     f :: Bool -> Thing -> Int
     f _ (Node v) = i'
         where i' = f (i' == 0) v
     f isZero Leaf = if isZero then 1 else 0

The boolean argument could be read as something like "will my result be 
unequal to itself?"

Dave



More information about the PRL mailing list