Gabriella439 / Haskell-Pipes-Safe-Library

Safety for the pipes ecosystem
BSD 3-Clause "New" or "Revised" License
26 stars 21 forks source link

Documentation Update Needed #43

Open Skyfold opened 5 years ago

Skyfold commented 5 years ago

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.

Gabriella439 commented 5 years ago

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

Skyfold commented 5 years ago

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.