{- |
Handling of exceptions.
-}
module Sound.MIDI.Parser.Exception where

import qualified Sound.MIDI.Parser.Report as Report

import qualified Control.Monad.Exception.Synchronous as Sync


type T m = Sync.ExceptionalT Report.UserMessage m


run :: Monad m =>
   T m a -> m (Sync.Exceptional Report.UserMessage a)
run :: forall (m :: * -> *) a.
Monad m =>
T m a -> m (Exceptional UserMessage a)
run = forall e (m :: * -> *) a. ExceptionalT e m a -> m (Exceptional e a)
Sync.runExceptionalT


giveUp :: Monad m => String -> T m a
giveUp :: forall (m :: * -> *) a. Monad m => UserMessage -> T m a
giveUp = forall (m :: * -> *) e a. Monad m => e -> ExceptionalT e m a
Sync.throwT

try :: Monad m => T m a -> m (Sync.Exceptional Report.UserMessage a)
try :: forall (m :: * -> *) a.
Monad m =>
T m a -> m (Exceptional UserMessage a)
try = forall (m :: * -> *) e a.
Monad m =>
ExceptionalT e m a -> m (Exceptional e a)
Sync.tryT