definition: |
safeReadGlobalP :: (Read a, Show a) => GlobalP a -> a -> IO a safeReadGlobalP g dflt = catch (readGlobalP g) (\err -> do hPutStrLn stderr $ "Error caught in 'safeReadGlobalP':\n" ++ show err writeGlobalP g dflt >> return dflt ) |
demand: |
no demanded arguments |
deterministic: |
deterministic operation |
documentation: |
Safely reads the current value of a global. If `readGlobalP` fails (e.g., due to a corrupted persistent storage), the global is re-initialized with the default value given as the second argument. |
failfree: |
(_, _, _, _) |
indeterministic: |
referentially transparent operation |
infix: |
no fixity defined |
iotype: |
{(_,_,_,_) |-> _} |
name: |
safeReadGlobalP |
precedence: |
no precedence defined |
result-values: |
_ |
signature: |
(Prelude.Read a, Prelude.Show a) => GlobalP a -> a -> Prelude.IO a |
solution-complete: |
operation might suspend on free variables |
terminating: |
possibly non-terminating |
totally-defined: |
reducible on all ground data terms |