    {-# LANGUAGE ScopedTypeVariables, StandaloneDeriving, TemplateHaskell #-}
    module Debian.Loc
        ( __LOC__
        , mapExn
        ) where

    import Control.Exception (Exception, throw)
    import Control.Monad.Catch (MonadCatch, catch)
    import Language.Haskell.TH

    __LOC__ :: Q Exp
    __LOC__ :: Q Exp
    __LOC__ = Q Loc
    location Q Loc -> (Loc -> Q Exp) -> Q Exp
    forall a b. Q a -> (a -> Q b) -> Q b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= \ Loc
    x ->
                 Name -> [Q (Name, Exp)] -> Q Exp
    forall (m :: * -> *). Quote m => Name -> [m (Name, Exp)] -> m Exp
    recConE 'Loc [ (,) (Name -> Exp -> (Name, Exp)) -> Q Name -> Q (Exp -> (Name, Exp))
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (Name -> Q Name
    forall a. a -> Q a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure 'loc_filename) Q (Exp -> (Name, Exp)) -> Q Exp -> Q (Name, Exp)
    forall a b. Q (a -> b) -> Q a -> Q b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> Lit -> Q Exp
    forall (m :: * -> *). Quote m => Lit -> m Exp
    litE (String -> Lit
    stringL (Loc -> String
    loc_filename Loc
    x))
                              , (,) (Name -> Exp -> (Name, Exp)) -> Q Name -> Q (Exp -> (Name, Exp))
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (Name -> Q Name
    forall a. a -> Q a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure 'loc_package) Q (Exp -> (Name, Exp)) -> Q Exp -> Q (Name, Exp)
    forall a b. Q (a -> b) -> Q a -> Q b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> Lit -> Q Exp
    forall (m :: * -> *). Quote m => Lit -> m Exp
    litE (String -> Lit
    stringL (Loc -> String
    loc_package Loc
    x))
                              , (,) (Name -> Exp -> (Name, Exp)) -> Q Name -> Q (Exp -> (Name, Exp))
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (Name -> Q Name
    forall a. a -> Q a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure 'loc_module) Q (Exp -> (Name, Exp)) -> Q Exp -> Q (Name, Exp)
    forall a b. Q (a -> b) -> Q a -> Q b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> Lit -> Q Exp
    forall (m :: * -> *). Quote m => Lit -> m Exp
    litE (String -> Lit
    stringL (Loc -> String
    loc_module Loc
    x))
                              , (,) (Name -> Exp -> (Name, Exp)) -> Q Name -> Q (Exp -> (Name, Exp))
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (Name -> Q Name
    forall a. a -> Q a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure 'loc_start) Q (Exp -> (Name, Exp)) -> Q Exp -> Q (Name, Exp)
    forall a b. Q (a -> b) -> Q a -> Q b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> [|($(Lit -> Q Exp
    forall (m :: * -> *). Quote m => Lit -> m Exp
    litE (Integer -> Lit
    integerL (Int -> Integer
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral ((Int, Int) -> Int
    forall a b. (a, b) -> a
    fst (Loc -> (Int, Int)
    loc_start Loc
    x))))),
                                                                 $(Lit -> Q Exp
    forall (m :: * -> *). Quote m => Lit -> m Exp
    litE (Integer -> Lit
    integerL (Int -> Integer
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral ((Int, Int) -> Int
    forall a b. (a, b) -> b
    snd (Loc -> (Int, Int)
    loc_start Loc
    x)))))) :: (Int, Int)|]
                              , (,) (Name -> Exp -> (Name, Exp)) -> Q Name -> Q (Exp -> (Name, Exp))
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (Name -> Q Name
    forall a. a -> Q a
    forall (f :: * -> *) a. Applicative f => a -> f a
    pure 'loc_end) Q (Exp -> (Name, Exp)) -> Q Exp -> Q (Name, Exp)
    forall a b. Q (a -> b) -> Q a -> Q b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> [|($(Lit -> Q Exp
    forall (m :: * -> *). Quote m => Lit -> m Exp
    litE (Integer -> Lit
    integerL (Int -> Integer
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral ((Int, Int) -> Int
    forall a b. (a, b) -> a
    fst (Loc -> (Int, Int)
    loc_end Loc
    x))))),
                                                               $(Lit -> Q Exp
    forall (m :: * -> *). Quote m => Lit -> m Exp
    litE (Integer -> Lit
    integerL (Int -> Integer
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral ((Int, Int) -> Int
    forall a b. (a, b) -> b
    snd (Loc -> (Int, Int)
    loc_end Loc
    x)))))) :: (Int, Int)|] ]

    mapExn :: forall e m a. (MonadCatch m, Exception e) => m a -> (e -> e) -> m a
    mapExn :: forall e (m :: * -> *) a.
    (MonadCatch m, Exception e) =>
    m a -> (e -> e) -> m a
    mapExn m a
    task e -> e
    f = m a
    task m a -> (e -> m a) -> m a
    forall e a. (HasCallStack, Exception e) => m a -> (e -> m a) -> m a
    forall (m :: * -> *) e a.
    (MonadCatch m, HasCallStack, Exception e) =>
    m a -> (e -> m a) -> m a
    `catch` (\ (e
    e :: e) -> e -> m a
    forall a e. (HasCallStack, Exception e) => e -> a
    throw (e -> e
    f e
    e))