module Jikka.Python.Language.Util where import Control.Monad.Identity import Jikka.Common.Location import Jikka.Python.Language.Expr constIntExp :: Integer -> Expr constIntExp :: Integer -> Expr constIntExp = Constant -> Expr Constant (Constant -> Expr) -> (Integer -> Constant) -> Integer -> Expr forall b c a. (b -> c) -> (a -> b) -> a -> c . Integer -> Constant ConstInt constBoolExp :: Bool -> Expr constBoolExp :: Bool -> Expr constBoolExp = Constant -> Expr Constant (Constant -> Expr) -> (Bool -> Constant) -> Bool -> Expr forall b c a. (b -> c) -> (a -> b) -> a -> c . Bool -> Constant ConstBool mapExprArgumentsM :: Monad m => (Expr' -> m Expr') -> Arguments -> m Arguments mapExprArgumentsM :: (Expr' -> m Expr') -> Arguments -> m Arguments mapExprArgumentsM Expr' -> m Expr' f Arguments args = do [Expr'] kwDefaults <- (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) (Arguments -> [Expr'] argsKwDefaults Arguments args) [Expr'] defaults <- (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) (Arguments -> [Expr'] argsDefaults Arguments args) Arguments -> m Arguments forall (m :: * -> *) a. Monad m => a -> m a return (Arguments -> m Arguments) -> Arguments -> m Arguments forall a b. (a -> b) -> a -> b $ Arguments args { argsKwDefaults :: [Expr'] argsKwDefaults = [Expr'] kwDefaults, argsDefaults :: [Expr'] argsDefaults = [Expr'] defaults } mapExprComprehensionM :: Monad m => (Expr' -> m Expr') -> Comprehension -> m Comprehension mapExprComprehensionM :: (Expr' -> m Expr') -> Comprehension -> m Comprehension mapExprComprehensionM Expr' -> m Expr' f Comprehension comp = do Expr' iter <- (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f (Comprehension -> Expr' compIter Comprehension comp) Expr' target <- (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f (Comprehension -> Expr' compIter Comprehension comp) Maybe Expr' ifs <- (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) (Comprehension -> Maybe Expr' compIfs Comprehension comp) Comprehension -> m Comprehension forall (m :: * -> *) a. Monad m => a -> m a return (Comprehension -> m Comprehension) -> Comprehension -> m Comprehension forall a b. (a -> b) -> a -> b $ Comprehension :: Expr' -> Expr' -> Maybe Expr' -> Comprehension Comprehension {compTarget :: Expr' compTarget = Expr' target, compIter :: Expr' compIter = Expr' iter, compIfs :: Maybe Expr' compIfs = Maybe Expr' ifs} mapExprComprehensionsM :: Monad m => (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] mapExprComprehensionsM :: (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] mapExprComprehensionsM Expr' -> m Expr' f = (Comprehension -> m Comprehension) -> [Comprehension] -> m [Comprehension] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Comprehension -> m Comprehension forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Comprehension -> m Comprehension mapExprComprehensionM Expr' -> m Expr' f) mapExprKeywordsM :: Monad m => (Expr' -> m Expr') -> [Keyword'] -> m [Keyword'] mapExprKeywordsM :: (Expr' -> m Expr') -> [Keyword'] -> m [Keyword'] mapExprKeywordsM Expr' -> m Expr' f [Keyword'] kwargs = (Keyword' -> m Keyword') -> [Keyword'] -> m [Keyword'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM (\(WithLoc Loc loc (Maybe Ident' k, Expr' v)) -> Loc -> (Maybe Ident', Expr') -> Keyword' forall a. Loc -> a -> WithLoc a WithLoc Loc loc ((Maybe Ident', Expr') -> Keyword') -> (Expr' -> (Maybe Ident', Expr')) -> Expr' -> Keyword' forall b c a. (b -> c) -> (a -> b) -> a -> c . (,) Maybe Ident' k (Expr' -> Keyword') -> m Expr' -> m Keyword' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' v) [Keyword'] kwargs mapExprM :: Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM :: (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f = Expr' -> m Expr' go where go :: Expr' -> m Expr' go Expr' e0 = Expr' -> m Expr' f (Expr' -> m Expr') -> (Expr -> Expr') -> Expr -> m Expr' forall b c a. (b -> c) -> (a -> b) -> a -> c . Loc -> Expr -> Expr' forall a. Loc -> a -> WithLoc a WithLoc (Expr' -> Loc forall a. WithLoc a -> Loc loc Expr' e0) (Expr -> m Expr') -> m Expr -> m Expr' forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b =<< case Expr' -> Expr forall a. WithLoc a -> a value Expr' e0 of BoolOp Expr' e1 BoolOp op Expr' e2 -> Expr' -> BoolOp -> Expr' -> Expr BoolOp (Expr' -> BoolOp -> Expr' -> Expr) -> m Expr' -> m (BoolOp -> Expr' -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e1 m (BoolOp -> Expr' -> Expr) -> m BoolOp -> m (Expr' -> Expr) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> BoolOp -> m BoolOp forall (f :: * -> *) a. Applicative f => a -> f a pure BoolOp op m (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Expr' -> m Expr' go Expr' e2 NamedExpr Expr' x Expr' e -> Expr' -> Expr' -> Expr NamedExpr (Expr' -> Expr' -> Expr) -> m Expr' -> m (Expr' -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' x m (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Expr' -> m Expr' go Expr' e BinOp Expr' e1 Operator op Expr' e2 -> Expr' -> Operator -> Expr' -> Expr BinOp (Expr' -> Operator -> Expr' -> Expr) -> m Expr' -> m (Operator -> Expr' -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e1 m (Operator -> Expr' -> Expr) -> m Operator -> m (Expr' -> Expr) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Operator -> m Operator forall (f :: * -> *) a. Applicative f => a -> f a pure Operator op m (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Expr' -> m Expr' go Expr' e2 UnaryOp UnaryOp op Expr' e -> UnaryOp -> Expr' -> Expr UnaryOp UnaryOp op (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e Lambda Arguments args Expr' body -> Arguments -> Expr' -> Expr Lambda (Arguments -> Expr' -> Expr) -> m Arguments -> m (Expr' -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Arguments -> m Arguments forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Arguments -> m Arguments mapExprArgumentsM Expr' -> m Expr' f Arguments args m (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' body IfExp Expr' e1 Expr' e2 Expr' e3 -> Expr' -> Expr' -> Expr' -> Expr IfExp (Expr' -> Expr' -> Expr' -> Expr) -> m Expr' -> m (Expr' -> Expr' -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e1 m (Expr' -> Expr' -> Expr) -> m Expr' -> m (Expr' -> Expr) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Expr' -> m Expr' go Expr' e2 m (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Expr' -> m Expr' go Expr' e3 Dict [(Maybe Expr', Expr')] es -> [(Maybe Expr', Expr')] -> Expr Dict ([(Maybe Expr', Expr')] -> Expr) -> m [(Maybe Expr', Expr')] -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> ((Maybe Expr', Expr') -> m (Maybe Expr', Expr')) -> [(Maybe Expr', Expr')] -> m [(Maybe Expr', Expr')] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM (\(Maybe Expr' k, Expr' v) -> (,) (Maybe Expr' -> Expr' -> (Maybe Expr', Expr')) -> m (Maybe Expr') -> m (Expr' -> (Maybe Expr', Expr')) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse Expr' -> m Expr' go Maybe Expr' k m (Expr' -> (Maybe Expr', Expr')) -> m Expr' -> m (Maybe Expr', Expr') forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Expr' -> m Expr' go Expr' v) [(Maybe Expr', Expr')] es Set [Expr'] es -> [Expr'] -> Expr Set ([Expr'] -> Expr) -> m [Expr'] -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM Expr' -> m Expr' go [Expr'] es ListComp Expr' e [Comprehension] comps -> Expr' -> [Comprehension] -> Expr ListComp (Expr' -> [Comprehension] -> Expr) -> m Expr' -> m ([Comprehension] -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e m ([Comprehension] -> Expr) -> m [Comprehension] -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] mapExprComprehensionsM Expr' -> m Expr' f [Comprehension] comps SetComp Expr' e [Comprehension] comps -> Expr' -> [Comprehension] -> Expr SetComp (Expr' -> [Comprehension] -> Expr) -> m Expr' -> m ([Comprehension] -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e m ([Comprehension] -> Expr) -> m [Comprehension] -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] mapExprComprehensionsM Expr' -> m Expr' f [Comprehension] comps DictComp Expr' k Expr' v [Comprehension] comps -> Expr' -> Expr' -> [Comprehension] -> Expr DictComp (Expr' -> Expr' -> [Comprehension] -> Expr) -> m Expr' -> m (Expr' -> [Comprehension] -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' k m (Expr' -> [Comprehension] -> Expr) -> m Expr' -> m ([Comprehension] -> Expr) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' v m ([Comprehension] -> Expr) -> m [Comprehension] -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] mapExprComprehensionsM Expr' -> m Expr' f [Comprehension] comps GeneratorExp Expr' e [Comprehension] comps -> Expr' -> [Comprehension] -> Expr GeneratorExp (Expr' -> [Comprehension] -> Expr) -> m Expr' -> m ([Comprehension] -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e m ([Comprehension] -> Expr) -> m [Comprehension] -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Comprehension] -> m [Comprehension] mapExprComprehensionsM Expr' -> m Expr' f [Comprehension] comps Await Expr' e -> Expr' -> Expr Await (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e Yield Maybe Expr' e -> Maybe Expr' -> Expr Yield (Maybe Expr' -> Expr) -> m (Maybe Expr') -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse Expr' -> m Expr' go Maybe Expr' e YieldFrom Expr' e -> Expr' -> Expr YieldFrom (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e Compare Expr' e [(CmpOp, Expr')] es -> Expr' -> [(CmpOp, Expr')] -> Expr Compare (Expr' -> [(CmpOp, Expr')] -> Expr) -> m Expr' -> m ([(CmpOp, Expr')] -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e m ([(CmpOp, Expr')] -> Expr) -> m [(CmpOp, Expr')] -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> ((CmpOp, Expr') -> m (CmpOp, Expr')) -> [(CmpOp, Expr')] -> m [(CmpOp, Expr')] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM (\(CmpOp op, Expr' e) -> (,) CmpOp op (Expr' -> (CmpOp, Expr')) -> m Expr' -> m (CmpOp, Expr') forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e) [(CmpOp, Expr')] es Call Expr' g [Expr'] args [Keyword'] kwargs -> Expr' -> [Expr'] -> [Keyword'] -> Expr Call (Expr' -> [Expr'] -> [Keyword'] -> Expr) -> m Expr' -> m ([Expr'] -> [Keyword'] -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' g m ([Expr'] -> [Keyword'] -> Expr) -> m [Expr'] -> m ([Keyword'] -> Expr) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM Expr' -> m Expr' go [Expr'] args m ([Keyword'] -> Expr) -> m [Keyword'] -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Keyword'] -> m [Keyword'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Keyword'] -> m [Keyword'] mapExprKeywordsM Expr' -> m Expr' f [Keyword'] kwargs FormattedValue Expr' e1 Maybe Char c Maybe Expr' e2 -> Expr' -> Maybe Char -> Maybe Expr' -> Expr FormattedValue (Expr' -> Maybe Char -> Maybe Expr' -> Expr) -> m Expr' -> m (Maybe Char -> Maybe Expr' -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e1 m (Maybe Char -> Maybe Expr' -> Expr) -> m (Maybe Char) -> m (Maybe Expr' -> Expr) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Maybe Char -> m (Maybe Char) forall (f :: * -> *) a. Applicative f => a -> f a pure Maybe Char c m (Maybe Expr' -> Expr) -> m (Maybe Expr') -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse Expr' -> m Expr' go Maybe Expr' e2 JoinedStr [Expr'] es -> [Expr'] -> Expr JoinedStr ([Expr'] -> Expr) -> m [Expr'] -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM Expr' -> m Expr' go [Expr'] es Constant Constant constant -> Expr -> m Expr forall (m :: * -> *) a. Monad m => a -> m a return (Expr -> m Expr) -> Expr -> m Expr forall a b. (a -> b) -> a -> b $ Constant -> Expr Constant Constant constant Attribute Expr' e Ident' x -> Expr' -> Ident' -> Expr Attribute (Expr' -> Ident' -> Expr) -> m Expr' -> m (Ident' -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e m (Ident' -> Expr) -> m Ident' -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Ident' -> m Ident' forall (f :: * -> *) a. Applicative f => a -> f a pure Ident' x Subscript Expr' e1 Expr' e2 -> Expr' -> Expr' -> Expr Subscript (Expr' -> Expr' -> Expr) -> m Expr' -> m (Expr' -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e1 m (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Expr' -> m Expr' go Expr' e2 Starred Expr' e -> Expr' -> Expr Starred (Expr' -> Expr) -> m Expr' -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Expr' -> m Expr' go Expr' e Name Ident' x -> Expr -> m Expr forall (m :: * -> *) a. Monad m => a -> m a return (Expr -> m Expr) -> Expr -> m Expr forall a b. (a -> b) -> a -> b $ Ident' -> Expr Name Ident' x List [Expr'] es -> [Expr'] -> Expr List ([Expr'] -> Expr) -> m [Expr'] -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM Expr' -> m Expr' go [Expr'] es Tuple [Expr'] es -> [Expr'] -> Expr Tuple ([Expr'] -> Expr) -> m [Expr'] -> m Expr forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM Expr' -> m Expr' go [Expr'] es Slice Maybe Expr' e1 Maybe Expr' e2 Maybe Expr' e3 -> Maybe Expr' -> Maybe Expr' -> Maybe Expr' -> Expr Slice (Maybe Expr' -> Maybe Expr' -> Maybe Expr' -> Expr) -> m (Maybe Expr') -> m (Maybe Expr' -> Maybe Expr' -> Expr) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse Expr' -> m Expr' go Maybe Expr' e1 m (Maybe Expr' -> Maybe Expr' -> Expr) -> m (Maybe Expr') -> m (Maybe Expr' -> Expr) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse Expr' -> m Expr' go Maybe Expr' e2 m (Maybe Expr' -> Expr) -> m (Maybe Expr') -> m Expr forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse Expr' -> m Expr' go Maybe Expr' e3 mapExprExceptHanderM :: Monad m => (Expr' -> m Expr') -> ExceptHandler' -> m ExceptHandler' mapExprExceptHanderM :: (Expr' -> m Expr') -> ExceptHandler' -> m ExceptHandler' mapExprExceptHanderM Expr' -> m Expr' f (WithLoc Loc loc ExceptHandler handler) = do [Statement'] body <- (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f (ExceptHandler -> [Statement'] exchBody ExceptHandler handler) ExceptHandler' -> m ExceptHandler' forall (m :: * -> *) a. Monad m => a -> m a return (ExceptHandler' -> m ExceptHandler') -> ExceptHandler' -> m ExceptHandler' forall a b. (a -> b) -> a -> b $ Loc -> ExceptHandler -> ExceptHandler' forall a. Loc -> a -> WithLoc a WithLoc Loc loc (ExceptHandler handler {exchBody :: [Statement'] exchBody = [Statement'] body}) mapExprStatementM :: Monad m => (Expr' -> m Expr') -> Statement' -> m Statement' mapExprStatementM :: (Expr' -> m Expr') -> Statement' -> m Statement' mapExprStatementM Expr' -> m Expr' f Statement' stmt = Loc -> Statement -> Statement' forall a. Loc -> a -> WithLoc a WithLoc (Statement' -> Loc forall a. WithLoc a -> Loc loc Statement' stmt) (Statement -> Statement') -> m Statement -> m Statement' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> case Statement' -> Statement forall a. WithLoc a -> a value Statement' stmt of FunctionDef Ident' g Arguments args [Statement'] body [Expr'] decorators Maybe Expr' ret -> Ident' -> Arguments -> [Statement'] -> [Expr'] -> Maybe Expr' -> Statement FunctionDef Ident' g Arguments args ([Statement'] -> [Expr'] -> Maybe Expr' -> Statement) -> m [Statement'] -> m ([Expr'] -> Maybe Expr' -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body m ([Expr'] -> Maybe Expr' -> Statement) -> m [Expr'] -> m (Maybe Expr' -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) [Expr'] decorators m (Maybe Expr' -> Statement) -> m (Maybe Expr') -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Maybe Expr' -> m (Maybe Expr') forall (f :: * -> *) a. Applicative f => a -> f a pure Maybe Expr' ret AsyncFunctionDef Ident' g Arguments args [Statement'] body [Expr'] decorators Maybe Expr' ret -> Ident' -> Arguments -> [Statement'] -> [Expr'] -> Maybe Expr' -> Statement AsyncFunctionDef Ident' g Arguments args ([Statement'] -> [Expr'] -> Maybe Expr' -> Statement) -> m [Statement'] -> m ([Expr'] -> Maybe Expr' -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body m ([Expr'] -> Maybe Expr' -> Statement) -> m [Expr'] -> m (Maybe Expr' -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) [Expr'] decorators m (Maybe Expr' -> Statement) -> m (Maybe Expr') -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Maybe Expr' -> m (Maybe Expr') forall (f :: * -> *) a. Applicative f => a -> f a pure Maybe Expr' ret ClassDef Ident' name [Expr'] bases [Keyword'] keywords [Statement'] body [Expr'] decorators -> Ident' -> [Expr'] -> [Keyword'] -> [Statement'] -> [Expr'] -> Statement ClassDef Ident' name ([Expr'] -> [Keyword'] -> [Statement'] -> [Expr'] -> Statement) -> m [Expr'] -> m ([Keyword'] -> [Statement'] -> [Expr'] -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) [Expr'] bases m ([Keyword'] -> [Statement'] -> [Expr'] -> Statement) -> m [Keyword'] -> m ([Statement'] -> [Expr'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Keyword'] -> m [Keyword'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Keyword'] -> m [Keyword'] mapExprKeywordsM Expr' -> m Expr' f [Keyword'] keywords m ([Statement'] -> [Expr'] -> Statement) -> m [Statement'] -> m ([Expr'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body m ([Expr'] -> Statement) -> m [Expr'] -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) [Expr'] decorators Return Maybe Expr' e -> Maybe Expr' -> Statement Return (Maybe Expr' -> Statement) -> m (Maybe Expr') -> m Statement forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) Maybe Expr' e Delete [Expr'] xs -> [Expr'] -> Statement Delete ([Expr'] -> Statement) -> m [Expr'] -> m Statement forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) [Expr'] xs Assign [Expr'] xs Expr' e -> [Expr'] -> Expr' -> Statement Assign ([Expr'] -> Expr' -> Statement) -> m [Expr'] -> m (Expr' -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Expr'] -> m [Expr'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) [Expr'] xs m (Expr' -> Statement) -> m Expr' -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e AugAssign Expr' x Operator op Expr' e -> Expr' -> Operator -> Expr' -> Statement AugAssign (Expr' -> Operator -> Expr' -> Statement) -> m Expr' -> m (Operator -> Expr' -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' x m (Operator -> Expr' -> Statement) -> m Operator -> m (Expr' -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Operator -> m Operator forall (f :: * -> *) a. Applicative f => a -> f a pure Operator op m (Expr' -> Statement) -> m Expr' -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e AnnAssign Expr' x Expr' t Maybe Expr' e -> Expr' -> Expr' -> Maybe Expr' -> Statement AnnAssign (Expr' -> Expr' -> Maybe Expr' -> Statement) -> m Expr' -> m (Expr' -> Maybe Expr' -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' x m (Expr' -> Maybe Expr' -> Statement) -> m Expr' -> m (Maybe Expr' -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' t m (Maybe Expr' -> Statement) -> m (Maybe Expr') -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) Maybe Expr' e For Expr' x Expr' iter [Statement'] body [Statement'] orelse -> Expr' -> Expr' -> [Statement'] -> [Statement'] -> Statement For (Expr' -> Expr' -> [Statement'] -> [Statement'] -> Statement) -> m Expr' -> m (Expr' -> [Statement'] -> [Statement'] -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' x m (Expr' -> [Statement'] -> [Statement'] -> Statement) -> m Expr' -> m ([Statement'] -> [Statement'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' iter m ([Statement'] -> [Statement'] -> Statement) -> m [Statement'] -> m ([Statement'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body m ([Statement'] -> Statement) -> m [Statement'] -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] orelse AsyncFor Expr' x Expr' iter [Statement'] body [Statement'] orelse -> Expr' -> Expr' -> [Statement'] -> [Statement'] -> Statement AsyncFor (Expr' -> Expr' -> [Statement'] -> [Statement'] -> Statement) -> m Expr' -> m (Expr' -> [Statement'] -> [Statement'] -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' x m (Expr' -> [Statement'] -> [Statement'] -> Statement) -> m Expr' -> m ([Statement'] -> [Statement'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' iter m ([Statement'] -> [Statement'] -> Statement) -> m [Statement'] -> m ([Statement'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body m ([Statement'] -> Statement) -> m [Statement'] -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] orelse While Expr' e [Statement'] body [Statement'] orelse -> Expr' -> [Statement'] -> [Statement'] -> Statement While (Expr' -> [Statement'] -> [Statement'] -> Statement) -> m Expr' -> m ([Statement'] -> [Statement'] -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e m ([Statement'] -> [Statement'] -> Statement) -> m [Statement'] -> m ([Statement'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body m ([Statement'] -> Statement) -> m [Statement'] -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] orelse If Expr' e [Statement'] body [Statement'] orelse -> Expr' -> [Statement'] -> [Statement'] -> Statement If (Expr' -> [Statement'] -> [Statement'] -> Statement) -> m Expr' -> m ([Statement'] -> [Statement'] -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e m ([Statement'] -> [Statement'] -> Statement) -> m [Statement'] -> m ([Statement'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body m ([Statement'] -> Statement) -> m [Statement'] -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] orelse With [WithItem] withitems [Statement'] body -> [WithItem] -> [Statement'] -> Statement With ([WithItem] -> [Statement'] -> Statement) -> m [WithItem] -> m ([Statement'] -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (WithItem -> m WithItem) -> [WithItem] -> m [WithItem] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM (\(Expr' e1, Maybe Expr' e2) -> (,) (Expr' -> Maybe Expr' -> WithItem) -> m Expr' -> m (Maybe Expr' -> WithItem) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e1 m (Maybe Expr' -> WithItem) -> m (Maybe Expr') -> m WithItem forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) Maybe Expr' e2) [WithItem] withitems m ([Statement'] -> Statement) -> m [Statement'] -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body AsyncWith [WithItem] withitems [Statement'] body -> [WithItem] -> [Statement'] -> Statement AsyncWith ([WithItem] -> [Statement'] -> Statement) -> m [WithItem] -> m ([Statement'] -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (WithItem -> m WithItem) -> [WithItem] -> m [WithItem] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM (\(Expr' e1, Maybe Expr' e2) -> (,) (Expr' -> Maybe Expr' -> WithItem) -> m Expr' -> m (Maybe Expr' -> WithItem) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e1 m (Maybe Expr' -> WithItem) -> m (Maybe Expr') -> m WithItem forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) Maybe Expr' e2) [WithItem] withitems m ([Statement'] -> Statement) -> m [Statement'] -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body Raise Maybe Expr' e1 Maybe Expr' e2 -> Maybe Expr' -> Maybe Expr' -> Statement Raise (Maybe Expr' -> Maybe Expr' -> Statement) -> m (Maybe Expr') -> m (Maybe Expr' -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) Maybe Expr' e1 m (Maybe Expr' -> Statement) -> m (Maybe Expr') -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) Maybe Expr' e2 Try [Statement'] body [ExceptHandler'] handlers [Statement'] orelse [Statement'] finalbody -> [Statement'] -> [ExceptHandler'] -> [Statement'] -> [Statement'] -> Statement Try ([Statement'] -> [ExceptHandler'] -> [Statement'] -> [Statement'] -> Statement) -> m [Statement'] -> m ([ExceptHandler'] -> [Statement'] -> [Statement'] -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] body m ([ExceptHandler'] -> [Statement'] -> [Statement'] -> Statement) -> m [ExceptHandler'] -> m ([Statement'] -> [Statement'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (ExceptHandler' -> m ExceptHandler') -> [ExceptHandler'] -> m [ExceptHandler'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> ExceptHandler' -> m ExceptHandler' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> ExceptHandler' -> m ExceptHandler' mapExprExceptHanderM Expr' -> m Expr' f) [ExceptHandler'] handlers m ([Statement'] -> [Statement'] -> Statement) -> m [Statement'] -> m ([Statement'] -> Statement) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] orelse m ([Statement'] -> Statement) -> m [Statement'] -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f [Statement'] finalbody Assert Expr' e1 Maybe Expr' e2 -> Expr' -> Maybe Expr' -> Statement Assert (Expr' -> Maybe Expr' -> Statement) -> m Expr' -> m (Maybe Expr' -> Statement) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e1 m (Maybe Expr' -> Statement) -> m (Maybe Expr') -> m Statement forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> (Expr' -> m Expr') -> Maybe Expr' -> m (Maybe Expr') forall (t :: * -> *) (f :: * -> *) a b. (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b) traverse ((Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f) Maybe Expr' e2 Import [Alias] aliases -> Statement -> m Statement forall (m :: * -> *) a. Monad m => a -> m a return (Statement -> m Statement) -> Statement -> m Statement forall a b. (a -> b) -> a -> b $ [Alias] -> Statement Import [Alias] aliases ImportFrom [Ident'] xs [Alias] aliases -> Statement -> m Statement forall (m :: * -> *) a. Monad m => a -> m a return (Statement -> m Statement) -> Statement -> m Statement forall a b. (a -> b) -> a -> b $ [Ident'] -> [Alias] -> Statement ImportFrom [Ident'] xs [Alias] aliases Global [Ident'] xs -> Statement -> m Statement forall (m :: * -> *) a. Monad m => a -> m a return (Statement -> m Statement) -> Statement -> m Statement forall a b. (a -> b) -> a -> b $ [Ident'] -> Statement Global [Ident'] xs Nonlocal [Ident'] xs -> Statement -> m Statement forall (m :: * -> *) a. Monad m => a -> m a return (Statement -> m Statement) -> Statement -> m Statement forall a b. (a -> b) -> a -> b $ [Ident'] -> Statement Nonlocal [Ident'] xs Expr' Expr' e -> Expr' -> Statement Expr' (Expr' -> Statement) -> m Expr' -> m Statement forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> (Expr' -> m Expr') -> Expr' -> m Expr' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Expr' -> m Expr' mapExprM Expr' -> m Expr' f Expr' e Statement Pass -> Statement -> m Statement forall (m :: * -> *) a. Monad m => a -> m a return Statement Pass Statement Break -> Statement -> m Statement forall (m :: * -> *) a. Monad m => a -> m a return Statement Break Statement Continue -> Statement -> m Statement forall (m :: * -> *) a. Monad m => a -> m a return Statement Continue mapExprStatementsM :: Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM :: (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM Expr' -> m Expr' f = (Statement' -> m Statement') -> [Statement'] -> m [Statement'] forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM ((Expr' -> m Expr') -> Statement' -> m Statement' forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> Statement' -> m Statement' mapExprStatementM Expr' -> m Expr' f) mapExprProgramM :: Monad m => (Expr' -> m Expr') -> Program -> m Program mapExprProgramM :: (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprProgramM = (Expr' -> m Expr') -> [Statement'] -> m [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM mapExprProgram :: (Expr' -> Expr') -> Program -> Program mapExprProgram :: (Expr' -> Expr') -> [Statement'] -> [Statement'] mapExprProgram Expr' -> Expr' f = Identity [Statement'] -> [Statement'] forall a. Identity a -> a runIdentity (Identity [Statement'] -> [Statement']) -> ([Statement'] -> Identity [Statement']) -> [Statement'] -> [Statement'] forall b c a. (b -> c) -> (a -> b) -> a -> c . (Expr' -> Identity Expr') -> [Statement'] -> Identity [Statement'] forall (m :: * -> *). Monad m => (Expr' -> m Expr') -> [Statement'] -> m [Statement'] mapExprStatementsM (Expr' -> Identity Expr' forall (m :: * -> *) a. Monad m => a -> m a return (Expr' -> Identity Expr') -> (Expr' -> Expr') -> Expr' -> Identity Expr' forall b c a. (b -> c) -> (a -> b) -> a -> c . Expr' -> Expr' f)