>>> fromJust (Just 1) 1
>>> 2 * (fromJust (Just 10)) 20
>>> 2 * (fromJust Nothing) *** Exception: Maybe.fromJust: Nothing ...WARNING: This function is partial. You can use case-matching instead.
catchJust (\e -> if isDoesNotExistErrorType (ioeGetErrorType e) then Just () else Nothing) (readFile f) (\_ -> do hPutStrLn stderr ("No such file: " ++ show f) return "")Any other exceptions which are not matched by the predicate are re-raised, and may be caught by an enclosing catch, catchJust, etc.