{-# LINE 1 "src/Data/Emacs/Module/Env/Functions.hsc" #-}
----------------------------------------------------------------------------
-- |
-- Module      :  Data.Emacs.Module.Env.Functions
-- Copyright   :  (c) Sergey Vinokurov 2018
-- License     :  Apache-2.0 (see LICENSE)
-- Maintainer  :  serg.foo@gmail.com
----------------------------------------------------------------------------

module Data.Emacs.Module.Env.Functions
  ( FuncallExit(..)
  , funcallExitToNum
  , funcallExitFromNum
  , foldFuncallExitFromNum
  ) where

import Data.Data (Data)
import Language.Haskell.TH.Syntax (Lift)
import Prettyprinter.Generics



-- | Possible Emacs function call outcomes. This is Haskell's version of
data FuncallExit a
  = -- | Function has returned normally.
    FuncallExitReturn
  | -- | Function has signaled an error using @signal@.
    FuncallExitSignal a
  | -- | Function has exit using @throw@.
    FuncallExitThrow a
  deriving (FuncallExit a -> FuncallExit a -> Bool
(FuncallExit a -> FuncallExit a -> Bool)
-> (FuncallExit a -> FuncallExit a -> Bool) -> Eq (FuncallExit a)
forall a. Eq a => FuncallExit a -> FuncallExit a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => FuncallExit a -> FuncallExit a -> Bool
== :: FuncallExit a -> FuncallExit a -> Bool
$c/= :: forall a. Eq a => FuncallExit a -> FuncallExit a -> Bool
/= :: FuncallExit a -> FuncallExit a -> Bool
Eq, Eq (FuncallExit a)
Eq (FuncallExit a) =>
(FuncallExit a -> FuncallExit a -> Ordering)
-> (FuncallExit a -> FuncallExit a -> Bool)
-> (FuncallExit a -> FuncallExit a -> Bool)
-> (FuncallExit a -> FuncallExit a -> Bool)
-> (FuncallExit a -> FuncallExit a -> Bool)
-> (FuncallExit a -> FuncallExit a -> FuncallExit a)
-> (FuncallExit a -> FuncallExit a -> FuncallExit a)
-> Ord (FuncallExit a)
FuncallExit a -> FuncallExit a -> Bool
FuncallExit a -> FuncallExit a -> Ordering
FuncallExit a -> FuncallExit a -> FuncallExit a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (FuncallExit a)
forall a. Ord a => FuncallExit a -> FuncallExit a -> Bool
forall a. Ord a => FuncallExit a -> FuncallExit a -> Ordering
forall a. Ord a => FuncallExit a -> FuncallExit a -> FuncallExit a
$ccompare :: forall a. Ord a => FuncallExit a -> FuncallExit a -> Ordering
compare :: FuncallExit a -> FuncallExit a -> Ordering
$c< :: forall a. Ord a => FuncallExit a -> FuncallExit a -> Bool
< :: FuncallExit a -> FuncallExit a -> Bool
$c<= :: forall a. Ord a => FuncallExit a -> FuncallExit a -> Bool
<= :: FuncallExit a -> FuncallExit a -> Bool
$c> :: forall a. Ord a => FuncallExit a -> FuncallExit a -> Bool
> :: FuncallExit a -> FuncallExit a -> Bool
$c>= :: forall a. Ord a => FuncallExit a -> FuncallExit a -> Bool
>= :: FuncallExit a -> FuncallExit a -> Bool
$cmax :: forall a. Ord a => FuncallExit a -> FuncallExit a -> FuncallExit a
max :: FuncallExit a -> FuncallExit a -> FuncallExit a
$cmin :: forall a. Ord a => FuncallExit a -> FuncallExit a -> FuncallExit a
min :: FuncallExit a -> FuncallExit a -> FuncallExit a
Ord, Int -> FuncallExit a -> ShowS
[FuncallExit a] -> ShowS
FuncallExit a -> String
(Int -> FuncallExit a -> ShowS)
-> (FuncallExit a -> String)
-> ([FuncallExit a] -> ShowS)
-> Show (FuncallExit a)
forall a. Show a => Int -> FuncallExit a -> ShowS
forall a. Show a => [FuncallExit a] -> ShowS
forall a. Show a => FuncallExit a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> FuncallExit a -> ShowS
showsPrec :: Int -> FuncallExit a -> ShowS
$cshow :: forall a. Show a => FuncallExit a -> String
show :: FuncallExit a -> String
$cshowList :: forall a. Show a => [FuncallExit a] -> ShowS
showList :: [FuncallExit a] -> ShowS
Show, Typeable (FuncallExit a)
Typeable (FuncallExit a) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> FuncallExit a -> c (FuncallExit a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (FuncallExit a))
-> (FuncallExit a -> Constr)
-> (FuncallExit a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (FuncallExit a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (FuncallExit a)))
-> ((forall b. Data b => b -> b) -> FuncallExit a -> FuncallExit a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r)
-> (forall u. (forall d. Data d => d -> u) -> FuncallExit a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> FuncallExit a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> FuncallExit a -> m (FuncallExit a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> FuncallExit a -> m (FuncallExit a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> FuncallExit a -> m (FuncallExit a))
-> Data (FuncallExit a)
FuncallExit a -> Constr
FuncallExit a -> DataType
(forall b. Data b => b -> b) -> FuncallExit a -> FuncallExit a
forall a. Data a => Typeable (FuncallExit a)
forall a. Data a => FuncallExit a -> Constr
forall a. Data a => FuncallExit a -> DataType
forall a.
Data a =>
(forall b. Data b => b -> b) -> FuncallExit a -> FuncallExit a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> FuncallExit a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> FuncallExit a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FuncallExit a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FuncallExit a -> c (FuncallExit a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (FuncallExit a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FuncallExit a))
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> FuncallExit a -> u
forall u. (forall d. Data d => d -> u) -> FuncallExit a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FuncallExit a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FuncallExit a -> c (FuncallExit a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (FuncallExit a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FuncallExit a))
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FuncallExit a -> c (FuncallExit a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> FuncallExit a -> c (FuncallExit a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FuncallExit a)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (FuncallExit a)
$ctoConstr :: forall a. Data a => FuncallExit a -> Constr
toConstr :: FuncallExit a -> Constr
$cdataTypeOf :: forall a. Data a => FuncallExit a -> DataType
dataTypeOf :: FuncallExit a -> DataType
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (FuncallExit a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (FuncallExit a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FuncallExit a))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (FuncallExit a))
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> FuncallExit a -> FuncallExit a
gmapT :: (forall b. Data b => b -> b) -> FuncallExit a -> FuncallExit a
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> FuncallExit a -> r
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> FuncallExit a -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> FuncallExit a -> [u]
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> FuncallExit a -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> FuncallExit a -> u
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> FuncallExit a -> m (FuncallExit a)
Data, (forall x. FuncallExit a -> Rep (FuncallExit a) x)
-> (forall x. Rep (FuncallExit a) x -> FuncallExit a)
-> Generic (FuncallExit a)
forall x. Rep (FuncallExit a) x -> FuncallExit a
forall x. FuncallExit a -> Rep (FuncallExit a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (FuncallExit a) x -> FuncallExit a
forall a x. FuncallExit a -> Rep (FuncallExit a) x
$cfrom :: forall a x. FuncallExit a -> Rep (FuncallExit a) x
from :: forall x. FuncallExit a -> Rep (FuncallExit a) x
$cto :: forall a x. Rep (FuncallExit a) x -> FuncallExit a
to :: forall x. Rep (FuncallExit a) x -> FuncallExit a
Generic, (forall (m :: * -> *). Quote m => FuncallExit a -> m Exp)
-> (forall (m :: * -> *).
    Quote m =>
    FuncallExit a -> Code m (FuncallExit a))
-> Lift (FuncallExit a)
forall a (m :: * -> *). (Lift a, Quote m) => FuncallExit a -> m Exp
forall a (m :: * -> *).
(Lift a, Quote m) =>
FuncallExit a -> Code m (FuncallExit a)
forall t.
(forall (m :: * -> *). Quote m => t -> m Exp)
-> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
forall (m :: * -> *). Quote m => FuncallExit a -> m Exp
forall (m :: * -> *).
Quote m =>
FuncallExit a -> Code m (FuncallExit a)
$clift :: forall a (m :: * -> *). (Lift a, Quote m) => FuncallExit a -> m Exp
lift :: forall (m :: * -> *). Quote m => FuncallExit a -> m Exp
$cliftTyped :: forall a (m :: * -> *).
(Lift a, Quote m) =>
FuncallExit a -> Code m (FuncallExit a)
liftTyped :: forall (m :: * -> *).
Quote m =>
FuncallExit a -> Code m (FuncallExit a)
Lift, (forall a b. (a -> b) -> FuncallExit a -> FuncallExit b)
-> (forall a b. a -> FuncallExit b -> FuncallExit a)
-> Functor FuncallExit
forall a b. a -> FuncallExit b -> FuncallExit a
forall a b. (a -> b) -> FuncallExit a -> FuncallExit b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> FuncallExit a -> FuncallExit b
fmap :: forall a b. (a -> b) -> FuncallExit a -> FuncallExit b
$c<$ :: forall a b. a -> FuncallExit b -> FuncallExit a
<$ :: forall a b. a -> FuncallExit b -> FuncallExit a
Functor, (forall m. Monoid m => FuncallExit m -> m)
-> (forall m a. Monoid m => (a -> m) -> FuncallExit a -> m)
-> (forall m a. Monoid m => (a -> m) -> FuncallExit a -> m)
-> (forall a b. (a -> b -> b) -> b -> FuncallExit a -> b)
-> (forall a b. (a -> b -> b) -> b -> FuncallExit a -> b)
-> (forall b a. (b -> a -> b) -> b -> FuncallExit a -> b)
-> (forall b a. (b -> a -> b) -> b -> FuncallExit a -> b)
-> (forall a. (a -> a -> a) -> FuncallExit a -> a)
-> (forall a. (a -> a -> a) -> FuncallExit a -> a)
-> (forall a. FuncallExit a -> [a])
-> (forall a. FuncallExit a -> Bool)
-> (forall a. FuncallExit a -> Int)
-> (forall a. Eq a => a -> FuncallExit a -> Bool)
-> (forall a. Ord a => FuncallExit a -> a)
-> (forall a. Ord a => FuncallExit a -> a)
-> (forall a. Num a => FuncallExit a -> a)
-> (forall a. Num a => FuncallExit a -> a)
-> Foldable FuncallExit
forall a. Eq a => a -> FuncallExit a -> Bool
forall a. Num a => FuncallExit a -> a
forall a. Ord a => FuncallExit a -> a
forall m. Monoid m => FuncallExit m -> m
forall a. FuncallExit a -> Bool
forall a. FuncallExit a -> Int
forall a. FuncallExit a -> [a]
forall a. (a -> a -> a) -> FuncallExit a -> a
forall m a. Monoid m => (a -> m) -> FuncallExit a -> m
forall b a. (b -> a -> b) -> b -> FuncallExit a -> b
forall a b. (a -> b -> b) -> b -> FuncallExit a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => FuncallExit m -> m
fold :: forall m. Monoid m => FuncallExit m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> FuncallExit a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> FuncallExit a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> FuncallExit a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> FuncallExit a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> FuncallExit a -> b
foldr :: forall a b. (a -> b -> b) -> b -> FuncallExit a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> FuncallExit a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> FuncallExit a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> FuncallExit a -> b
foldl :: forall b a. (b -> a -> b) -> b -> FuncallExit a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> FuncallExit a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> FuncallExit a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> FuncallExit a -> a
foldr1 :: forall a. (a -> a -> a) -> FuncallExit a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> FuncallExit a -> a
foldl1 :: forall a. (a -> a -> a) -> FuncallExit a -> a
$ctoList :: forall a. FuncallExit a -> [a]
toList :: forall a. FuncallExit a -> [a]
$cnull :: forall a. FuncallExit a -> Bool
null :: forall a. FuncallExit a -> Bool
$clength :: forall a. FuncallExit a -> Int
length :: forall a. FuncallExit a -> Int
$celem :: forall a. Eq a => a -> FuncallExit a -> Bool
elem :: forall a. Eq a => a -> FuncallExit a -> Bool
$cmaximum :: forall a. Ord a => FuncallExit a -> a
maximum :: forall a. Ord a => FuncallExit a -> a
$cminimum :: forall a. Ord a => FuncallExit a -> a
minimum :: forall a. Ord a => FuncallExit a -> a
$csum :: forall a. Num a => FuncallExit a -> a
sum :: forall a. Num a => FuncallExit a -> a
$cproduct :: forall a. Num a => FuncallExit a -> a
product :: forall a. Num a => FuncallExit a -> a
Foldable, Functor FuncallExit
Foldable FuncallExit
(Functor FuncallExit, Foldable FuncallExit) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> FuncallExit a -> f (FuncallExit b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    FuncallExit (f a) -> f (FuncallExit a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> FuncallExit a -> m (FuncallExit b))
-> (forall (m :: * -> *) a.
    Monad m =>
    FuncallExit (m a) -> m (FuncallExit a))
-> Traversable FuncallExit
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
FuncallExit (m a) -> m (FuncallExit a)
forall (f :: * -> *) a.
Applicative f =>
FuncallExit (f a) -> f (FuncallExit a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> FuncallExit a -> m (FuncallExit b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> FuncallExit a -> f (FuncallExit b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> FuncallExit a -> f (FuncallExit b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> FuncallExit a -> f (FuncallExit b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
FuncallExit (f a) -> f (FuncallExit a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
FuncallExit (f a) -> f (FuncallExit a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> FuncallExit a -> m (FuncallExit b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> FuncallExit a -> m (FuncallExit b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
FuncallExit (m a) -> m (FuncallExit a)
sequence :: forall (m :: * -> *) a.
Monad m =>
FuncallExit (m a) -> m (FuncallExit a)
Traversable)

instance Pretty a => Pretty (FuncallExit a) where
  pretty :: forall ann. FuncallExit a -> Doc ann
pretty = FuncallExit a -> Doc ann
forall a ann. (Generic a, GPretty (Rep a)) => a -> Doc ann
ppGeneric

{-# INLINE funcallExitToNum #-}
funcallExitToNum :: Num a => FuncallExit b -> a
funcallExitToNum :: forall a b. Num a => FuncallExit b -> a
funcallExitToNum = \case
  FuncallExit b
FuncallExitReturn   -> (a
0)
{-# LINE 39 "src/Data/Emacs/Module/Env/Functions.hsc" #-}
  FuncallExitSignal{} -> (1)
{-# LINE 40 "src/Data/Emacs/Module/Env/Functions.hsc" #-}
  FuncallExitThrow{}  -> (2)
{-# LINE 41 "src/Data/Emacs/Module/Env/Functions.hsc" #-}

{-# INLINE funcallExitFromNum #-}
funcallExitFromNum :: (Eq a, Num a) => a -> Maybe (FuncallExit ())
funcallExitFromNum :: forall a. (Eq a, Num a) => a -> Maybe (FuncallExit ())
funcallExitFromNum = \case
  (a
0) -> FuncallExit () -> Maybe (FuncallExit ())
forall a. a -> Maybe a
Just FuncallExit ()
forall a. FuncallExit a
FuncallExitReturn
{-# LINE 46 "src/Data/Emacs/Module/Env/Functions.hsc" #-}
  (1) -> Just $ FuncallExitSignal ()
{-# LINE 47 "src/Data/Emacs/Module/Env/Functions.hsc" #-}
  (2)  -> Just $ FuncallExitThrow ()
{-# LINE 48 "src/Data/Emacs/Module/Env/Functions.hsc" #-}
  _                                  -> Nothing

{-# INLINE foldFuncallExitFromNum #-}
foldFuncallExitFromNum :: (Eq a, Num a) => a -> b -> (FuncallExit () -> b) -> b
foldFuncallExitFromNum :: forall a b. (Eq a, Num a) => a -> b -> (FuncallExit () -> b) -> b
foldFuncallExitFromNum a
x b
def FuncallExit () -> b
f = case a
x of
  (a
0) -> FuncallExit () -> b
f FuncallExit ()
forall a. FuncallExit a
FuncallExitReturn
{-# LINE 54 "src/Data/Emacs/Module/Env/Functions.hsc" #-}
  (1) -> f $ FuncallExitSignal ()
{-# LINE 55 "src/Data/Emacs/Module/Env/Functions.hsc" #-}
  (2)  -> f $ FuncallExitThrow ()
{-# LINE 56 "src/Data/Emacs/Module/Env/Functions.hsc" #-}
  _                                  -> def