Haskell-Pipes-Safe-Library icon indicating copy to clipboard operation
Haskell-Pipes-Safe-Library copied to clipboard

Documentation Update Needed

Open Skyfold opened this issue 6 years ago • 2 comments

In Pipes.Safe you have this comment:

{-| This module provides an orphan 'MonadCatch' instance for 'Proxy' of the
    form:
> instance (MonadCatch m, MonadIO m) => MonadCatch (Proxy a' a b' b m) where

However, the only orphan instance I can find in that file (or re-exported by that file) is MonadMask for Proxy:

instance (MonadMask m, MonadIO m) => MonadMask (Proxy a' a b' b m) where
    mask = liftMask mask

    uninterruptibleMask = liftMask uninterruptibleMask

#if MIN_VERSION_exceptions(0,10,0)
    generalBracket acquire release_ use = mask $ \unmasked -> do
      a <- acquire
      let action = do
              b <- use a
              return (ExitCaseSuccess b, ExitCaseSuccess_ b)
      let handler e = return (ExitCaseException e, ExitCaseException_ e)
      (exitCase, exitCase_) <- unmasked action `catch` handler
      c <- release_ a exitCase
      case exitCase_ of
          ExitCaseException_ e -> throwM e
          ExitCaseSuccess_ b   -> return (b, c)

If this is a mistake I can make a pull request with the updated documentation.

Skyfold avatar Sep 01 '19 18:09 Skyfold

@Skyfold: Sorry for the delay! Yeah, that is a documentation mistake and I'd welcome the pull request 🙂

Gabriella439 avatar Sep 05 '19 15:09 Gabriella439

No problem, I will submit a pull request in the morning after I've had some sleep. I was very confused by what liftMask was doing for awhile. Its a clever piece of code.

Skyfold avatar Sep 05 '19 18:09 Skyfold