getResult :: IO (Error, Hook)
          -> IO (Either Error Hook)
getResult =
    liftM (uncurry checkResult)
    where checkResult err hook =
            if err == ErrOk then
                Right hook
            else
                Left err
getResult :: IO (Error, Hook)
          -> IO (Either Error Hook)
getResult =
    liftM (uncurry checkResult)
    where checkResult err hook =
            if err == ErrOk then
                Right hook
            else
                Left err
getResult =
    liftM (uncurry checkResult)
    where checkResult err hook =
            if err == ErrOk then
                Right hook
            else
                Left err