|
definition: |
computeFixpoint :: Bool -> Int -> (a->String) -> (a->a->Bool) -> (a->a) -> a
-> IO a
computeFixpoint withprint n prt eq f v = do
if withprint then putStrLn (show n ++ ": " ++ prt v)
else putStr (' ':show n) >> hFlush stdout
let fv = f v
if eq v fv
then do putStrLn $ "\nFixpoint reached after " ++ show n ++ " iterations"
return v
else computeFixpoint withprint (n+1) prt eq f fv
|
|
demand: |
no demanded arguments |
|
deterministic: |
deterministic operation |
|
documentation: |
Performs an iterated fixpoint computation. |
|
failfree: |
(_, _, _, _, _, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{(_,_,_,_,_,_) |-> _}
|
|
name: |
computeFixpoint |
|
precedence: |
no precedence defined |
|
result-values: |
_ |
|
signature: |
Prelude.Bool -> Prelude.Int -> (a -> String) -> (a -> a -> Prelude.Bool) -> (a -> a) -> a -> Prelude.IO a |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |