{-# LANGUAGE FlexibleInstances     #-}
{-# LANGUAGE InstanceSigs          #-}
{-# LANGUAGE LambdaCase            #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NamedFieldPuns        #-}
{-# LANGUAGE RecordWildCards       #-}
{-# LANGUAGE ScopedTypeVariables   #-}
{-# LANGUAGE StrictData            #-}
{-# LANGUAGE TypeFamilies          #-}
module Language.Cimple.TraverseAst
    ( traverseAst

    , doFiles, doFile
    , doNodes, doNode
    , doLexemes, doLexeme
    , doText

    , astActions
    , TextActions, textActions
    , IdentityActions, identityActions
    ) where

import           Data.Fix              (Fix (..))
import           Language.Cimple.AST   (Node, NodeF (..))
import           Language.Cimple.Lexer (Lexeme (..))

class TraverseAst itext otext a where
    type Mapped itext otext a
    mapFileAst
        :: Applicative f
        => AstActions f itext otext
        -> FilePath
        -> a
        -> f (Mapped itext otext a)

traverseAst
    :: (TraverseAst itext otext    a, Applicative f)
    => AstActions f itext otext -> a
    -> f    (Mapped itext otext    a)
traverseAst :: AstActions f itext otext -> a -> f (Mapped itext otext a)
traverseAst = (AstActions f itext otext
 -> FilePath -> a -> f (Mapped itext otext a))
-> FilePath
-> AstActions f itext otext
-> a
-> f (Mapped itext otext a)
forall a b c. (a -> b -> c) -> b -> a -> c
flip AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
forall itext otext a (f :: * -> *).
(TraverseAst itext otext a, Applicative f) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst FilePath
"<stdin>"

data AstActions f itext otext = AstActions
    { AstActions f itext otext
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
doFiles     :: [(FilePath, [Node (Lexeme itext)])] -> f [(FilePath, [Node (Lexeme otext)])] -> f [(FilePath, [Node (Lexeme otext)])]
    , AstActions f itext otext
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFile      ::  (FilePath, [Node (Lexeme itext)])  -> f  (FilePath, [Node (Lexeme otext)])  -> f  (FilePath, [Node (Lexeme otext)])
    , AstActions f itext otext
-> FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doNodes     :: FilePath -> [Node (Lexeme itext)]   -> f             [Node (Lexeme otext)]   -> f             [Node (Lexeme otext)]
    , AstActions f itext otext
-> FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNode      :: FilePath ->  Node (Lexeme itext)    -> f             (Node (Lexeme otext))   -> f             (Node (Lexeme otext))
    , AstActions f itext otext
-> FilePath
-> [Lexeme itext]
-> f [Lexeme otext]
-> f [Lexeme otext]
doLexemes   :: FilePath ->       [Lexeme itext]    -> f                   [Lexeme otext]    -> f                   [Lexeme otext]
    , AstActions f itext otext
-> FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexeme    :: FilePath ->        Lexeme itext     -> f                   (Lexeme otext)    -> f                   (Lexeme otext)
    , AstActions f itext otext -> FilePath -> itext -> f otext
doText      :: FilePath ->               itext                                              -> f                           otext
    }

instance TraverseAst itext otext        a
      => TraverseAst itext otext (Maybe a) where
    type        Mapped itext otext (Maybe a)
       = Maybe (Mapped itext otext        a)
    mapFileAst :: AstActions f itext otext
-> FilePath -> Maybe a -> f (Mapped itext otext (Maybe a))
mapFileAst AstActions f itext otext
_       FilePath
_           Maybe a
Nothing  = Maybe (Mapped itext otext a) -> f (Maybe (Mapped itext otext a))
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe (Mapped itext otext a)
forall a. Maybe a
Nothing
    mapFileAst AstActions f itext otext
actions FilePath
currentFile (Just a
x) = Mapped itext otext a -> Maybe (Mapped itext otext a)
forall a. a -> Maybe a
Just (Mapped itext otext a -> Maybe (Mapped itext otext a))
-> f (Mapped itext otext a) -> f (Maybe (Mapped itext otext a))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
forall itext otext a (f :: * -> *).
(TraverseAst itext otext a, Applicative f) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile a
x

astActions
    :: Applicative f
    => (itext -> f otext)
    -> AstActions f itext otext
astActions :: (itext -> f otext) -> AstActions f itext otext
astActions itext -> f otext
ft = AstActions :: forall (f :: * -> *) itext otext.
([(FilePath, [Node (Lexeme itext)])]
 -> f [(FilePath, [Node (Lexeme otext)])]
 -> f [(FilePath, [Node (Lexeme otext)])])
-> ((FilePath, [Node (Lexeme itext)])
    -> f (FilePath, [Node (Lexeme otext)])
    -> f (FilePath, [Node (Lexeme otext)]))
-> (FilePath
    -> [Node (Lexeme itext)]
    -> f [Node (Lexeme otext)]
    -> f [Node (Lexeme otext)])
-> (FilePath
    -> Node (Lexeme itext)
    -> f (Node (Lexeme otext))
    -> f (Node (Lexeme otext)))
-> (FilePath
    -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext])
-> (FilePath
    -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext))
-> (FilePath -> itext -> f otext)
-> AstActions f itext otext
AstActions
    { doFiles :: [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
doFiles     = (f [(FilePath, [Node (Lexeme otext)])]
 -> f [(FilePath, [Node (Lexeme otext)])])
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
forall a b. a -> b -> a
const f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
forall a. a -> a
id
    , doFile :: (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFile      = (f (FilePath, [Node (Lexeme otext)])
 -> f (FilePath, [Node (Lexeme otext)]))
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
forall a b. a -> b -> a
const f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
forall a. a -> a
id
    , doNodes :: FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doNodes     = ([Node (Lexeme itext)]
 -> f [Node (Lexeme otext)] -> f [Node (Lexeme otext)])
-> FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
forall a b. a -> b -> a
const (([Node (Lexeme itext)]
  -> f [Node (Lexeme otext)] -> f [Node (Lexeme otext)])
 -> FilePath
 -> [Node (Lexeme itext)]
 -> f [Node (Lexeme otext)]
 -> f [Node (Lexeme otext)])
-> ([Node (Lexeme itext)]
    -> f [Node (Lexeme otext)] -> f [Node (Lexeme otext)])
-> FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
forall a b. (a -> b) -> a -> b
$ (f [Node (Lexeme otext)] -> f [Node (Lexeme otext)])
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
forall a b. a -> b -> a
const f [Node (Lexeme otext)] -> f [Node (Lexeme otext)]
forall a. a -> a
id
    , doNode :: FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNode      = (Node (Lexeme itext)
 -> f (Node (Lexeme otext)) -> f (Node (Lexeme otext)))
-> FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
forall a b. a -> b -> a
const ((Node (Lexeme itext)
  -> f (Node (Lexeme otext)) -> f (Node (Lexeme otext)))
 -> FilePath
 -> Node (Lexeme itext)
 -> f (Node (Lexeme otext))
 -> f (Node (Lexeme otext)))
-> (Node (Lexeme itext)
    -> f (Node (Lexeme otext)) -> f (Node (Lexeme otext)))
-> FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
forall a b. (a -> b) -> a -> b
$ (f (Node (Lexeme otext)) -> f (Node (Lexeme otext)))
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
forall a b. a -> b -> a
const f (Node (Lexeme otext)) -> f (Node (Lexeme otext))
forall a. a -> a
id
    , doLexeme :: FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexeme    = (Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext))
-> FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
forall a b. a -> b -> a
const ((Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext))
 -> FilePath
 -> Lexeme itext
 -> f (Lexeme otext)
 -> f (Lexeme otext))
-> (Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext))
-> FilePath
-> Lexeme itext
-> f (Lexeme otext)
-> f (Lexeme otext)
forall a b. (a -> b) -> a -> b
$ (f (Lexeme otext) -> f (Lexeme otext))
-> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
forall a b. a -> b -> a
const f (Lexeme otext) -> f (Lexeme otext)
forall a. a -> a
id
    , doLexemes :: FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
doLexemes   = ([Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext])
-> FilePath
-> [Lexeme itext]
-> f [Lexeme otext]
-> f [Lexeme otext]
forall a b. a -> b -> a
const (([Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext])
 -> FilePath
 -> [Lexeme itext]
 -> f [Lexeme otext]
 -> f [Lexeme otext])
-> ([Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext])
-> FilePath
-> [Lexeme itext]
-> f [Lexeme otext]
-> f [Lexeme otext]
forall a b. (a -> b) -> a -> b
$ (f [Lexeme otext] -> f [Lexeme otext])
-> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
forall a b. a -> b -> a
const f [Lexeme otext] -> f [Lexeme otext]
forall a. a -> a
id
    , doText :: FilePath -> itext -> f otext
doText      = (itext -> f otext) -> FilePath -> itext -> f otext
forall a b. a -> b -> a
const itext -> f otext
ft
    }

type TextActions f itext otext = AstActions f itext otext
textActions :: Applicative f => (itext -> f otext) -> TextActions f itext otext
textActions :: (itext -> f otext) -> TextActions f itext otext
textActions = (itext -> f otext) -> TextActions f itext otext
forall (f :: * -> *) itext otext.
Applicative f =>
(itext -> f otext) -> AstActions f itext otext
astActions

type IdentityActions f text = AstActions f text text
identityActions :: Applicative f => AstActions f text text
identityActions :: AstActions f text text
identityActions = (text -> f text) -> AstActions f text text
forall (f :: * -> *) itext otext.
Applicative f =>
(itext -> f otext) -> AstActions f itext otext
astActions text -> f text
forall (f :: * -> *) a. Applicative f => a -> f a
pure


instance TraverseAst itext otext (Lexeme itext) where
    type Mapped itext otext (Lexeme itext)
                          =  Lexeme otext
    mapFileAst :: forall f . Applicative f
               => AstActions f itext otext -> FilePath -> Lexeme itext -> f (Lexeme otext)
    mapFileAst :: AstActions f itext otext
-> FilePath -> Lexeme itext -> f (Lexeme otext)
mapFileAst AstActions{FilePath -> itext -> f otext
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
[(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
(FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doText :: FilePath -> itext -> f otext
doLexeme :: FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
doNode :: FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
doText :: forall (f :: * -> *) itext otext.
AstActions f itext otext -> FilePath -> itext -> f otext
doLexeme :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Lexeme itext]
-> f [Lexeme otext]
-> f [Lexeme otext]
doNode :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
..} FilePath
currentFile = FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexeme FilePath
currentFile (Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext))
-> (Lexeme itext -> f (Lexeme otext))
-> Lexeme itext
-> f (Lexeme otext)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
        \(L AlexPosn
p LexemeClass
c itext
s) -> AlexPosn -> LexemeClass -> otext -> Lexeme otext
forall text. AlexPosn -> LexemeClass -> text -> Lexeme text
L AlexPosn
p LexemeClass
c (otext -> Lexeme otext) -> f otext -> f (Lexeme otext)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> FilePath -> itext -> f otext
doText FilePath
currentFile itext
s

instance TraverseAst itext otext [Lexeme itext] where
    type Mapped itext otext [Lexeme itext]
                          = [Lexeme otext]
    mapFileAst :: AstActions f itext otext
-> FilePath
-> [Lexeme itext]
-> f (Mapped itext otext [Lexeme itext])
mapFileAst actions :: AstActions f itext otext
actions@AstActions{FilePath -> itext -> f otext
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
[(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
(FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doText :: FilePath -> itext -> f otext
doLexeme :: FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
doNode :: FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
doText :: forall (f :: * -> *) itext otext.
AstActions f itext otext -> FilePath -> itext -> f otext
doLexeme :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Lexeme itext]
-> f [Lexeme otext]
-> f [Lexeme otext]
doNode :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
..} FilePath
currentFile = FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
doLexemes FilePath
currentFile ([Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext])
-> ([Lexeme itext] -> f [Lexeme otext])
-> [Lexeme itext]
-> f [Lexeme otext]
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
        (Lexeme itext -> f (Lexeme otext))
-> [Lexeme itext] -> f [Lexeme otext]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (AstActions f itext otext
-> FilePath
-> Lexeme itext
-> f (Mapped itext otext (Lexeme itext))
forall itext otext a (f :: * -> *).
(TraverseAst itext otext a, Applicative f) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile)

instance TraverseAst itext otext (Node (Lexeme itext)) where
    type Mapped itext otext (Node (Lexeme itext))
                          =  Node (Lexeme otext)
    mapFileAst
        :: forall f . Applicative f
        => AstActions f itext otext
        -> FilePath
        ->    Node (Lexeme itext)
        -> f (Node (Lexeme otext))
    mapFileAst :: AstActions f itext otext
-> FilePath -> Node (Lexeme itext) -> f (Node (Lexeme otext))
mapFileAst actions :: AstActions f itext otext
actions@AstActions{FilePath -> itext -> f otext
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
[(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
(FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doText :: FilePath -> itext -> f otext
doLexeme :: FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
doNode :: FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
doText :: forall (f :: * -> *) itext otext.
AstActions f itext otext -> FilePath -> itext -> f otext
doLexeme :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Lexeme itext]
-> f [Lexeme otext]
-> f [Lexeme otext]
doNode :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
..} FilePath
currentFile = FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNode FilePath
currentFile (Node (Lexeme itext)
 -> f (Node (Lexeme otext)) -> f (Node (Lexeme otext)))
-> (Node (Lexeme itext) -> f (Node (Lexeme otext)))
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> \Node (Lexeme itext)
node -> case Node (Lexeme itext) -> NodeF (Lexeme itext) (Node (Lexeme itext))
forall (f :: * -> *). Fix f -> f (Fix f)
unFix Node (Lexeme itext)
node of
        PreprocInclude Lexeme itext
path ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
PreprocInclude (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
path)
        PreprocDefine Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
PreprocDefine (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        PreprocDefineConst Lexeme itext
name Node (Lexeme itext)
value ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> a -> NodeF lexeme a
PreprocDefineConst (Lexeme otext
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
value)
        PreprocDefineMacro Lexeme itext
name [Node (Lexeme itext)]
params Node (Lexeme itext)
body ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Node (Lexeme otext)]
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> [a] -> a -> NodeF lexeme a
PreprocDefineMacro (Lexeme otext
 -> [Node (Lexeme otext)]
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Node (Lexeme otext)]
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f ([Node (Lexeme otext)]
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
params f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
body)
        PreprocIf Node (Lexeme itext)
cond [Node (Lexeme itext)]
thenDecls Node (Lexeme itext)
elseBranch ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> [Node (Lexeme otext)]
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> [a] -> a -> NodeF lexeme a
PreprocIf (Node (Lexeme otext)
 -> [Node (Lexeme otext)]
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f ([Node (Lexeme otext)]
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
cond f ([Node (Lexeme otext)]
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
thenDecls f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
elseBranch)
        PreprocIfdef Lexeme itext
name [Node (Lexeme itext)]
thenDecls Node (Lexeme itext)
elseBranch ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Node (Lexeme otext)]
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> [a] -> a -> NodeF lexeme a
PreprocIfdef (Lexeme otext
 -> [Node (Lexeme otext)]
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Node (Lexeme otext)]
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f ([Node (Lexeme otext)]
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
thenDecls f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
elseBranch)
        PreprocIfndef Lexeme itext
name [Node (Lexeme itext)]
thenDecls Node (Lexeme itext)
elseBranch ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Node (Lexeme otext)]
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> [a] -> a -> NodeF lexeme a
PreprocIfndef (Lexeme otext
 -> [Node (Lexeme otext)]
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Node (Lexeme otext)]
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f ([Node (Lexeme otext)]
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
thenDecls f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
elseBranch)
        PreprocElse [Node (Lexeme itext)]
decls ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Node (Lexeme otext)] -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. [a] -> NodeF lexeme a
PreprocElse ([Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
decls)
        PreprocElif Node (Lexeme itext)
cond [Node (Lexeme itext)]
decls Node (Lexeme itext)
elseBranch ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> [Node (Lexeme otext)]
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> [a] -> a -> NodeF lexeme a
PreprocElif (Node (Lexeme otext)
 -> [Node (Lexeme otext)]
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f ([Node (Lexeme otext)]
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
cond f ([Node (Lexeme otext)]
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
decls f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
elseBranch)
        PreprocUndef Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
PreprocUndef (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        PreprocDefined Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
PreprocDefined (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        PreprocScopedDefine Node (Lexeme itext)
define [Node (Lexeme itext)]
stmts Node (Lexeme itext)
undef ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> [Node (Lexeme otext)]
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> [a] -> a -> NodeF lexeme a
PreprocScopedDefine (Node (Lexeme otext)
 -> [Node (Lexeme otext)]
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f ([Node (Lexeme otext)]
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
define f ([Node (Lexeme otext)]
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
stmts f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
undef)
        MacroBodyStmt Node (Lexeme itext)
stmts ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> NodeF lexeme a
MacroBodyStmt (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
stmts)
        MacroBodyFunCall Node (Lexeme itext)
expr ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> NodeF lexeme a
MacroBodyFunCall (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        MacroParam Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
MacroParam (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        StaticAssert Node (Lexeme itext)
cond Lexeme itext
msg ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> lexeme -> NodeF lexeme a
StaticAssert (Node (Lexeme otext)
 -> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
cond f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
msg)
        LicenseDecl Lexeme itext
license [Node (Lexeme itext)]
copyrights ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Node (Lexeme otext)]
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> [a] -> NodeF lexeme a
LicenseDecl (Lexeme otext
 -> [Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Node (Lexeme otext)]
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
license f ([Node (Lexeme otext)]
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
copyrights)
        CopyrightDecl Lexeme itext
from Maybe (Lexeme itext)
to [Lexeme itext]
owner ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> Maybe (Lexeme otext)
-> [Lexeme otext]
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a.
lexeme -> Maybe lexeme -> [lexeme] -> NodeF lexeme a
CopyrightDecl (Lexeme otext
 -> Maybe (Lexeme otext)
 -> [Lexeme otext]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (Maybe (Lexeme otext)
      -> [Lexeme otext] -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
from f (Maybe (Lexeme otext)
   -> [Lexeme otext] -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Maybe (Lexeme otext))
-> f ([Lexeme otext] -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe (Lexeme itext)
-> f (Mapped itext otext (Maybe (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Maybe (Lexeme itext)
to f ([Lexeme otext] -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Lexeme otext]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Lexeme itext] -> f (Mapped itext otext [Lexeme itext])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Lexeme itext]
owner)
        Comment CommentStyle
doc Lexeme itext
start [Lexeme itext]
contents Lexeme itext
end ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (CommentStyle
-> Lexeme otext
-> [Lexeme otext]
-> Lexeme otext
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a.
CommentStyle -> lexeme -> [lexeme] -> lexeme -> NodeF lexeme a
Comment CommentStyle
doc (Lexeme otext
 -> [Lexeme otext]
 -> Lexeme otext
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Lexeme otext]
      -> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
start f ([Lexeme otext]
   -> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Lexeme otext]
-> f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Lexeme itext] -> f (Mapped itext otext [Lexeme itext])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Lexeme itext]
contents f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
end)
        CommentBlock Lexeme itext
comment ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
CommentBlock (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
comment)
        Commented Node (Lexeme itext)
comment Node (Lexeme itext)
subject ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
Commented (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
comment f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
subject)
        ExternC [Node (Lexeme itext)]
decls ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Node (Lexeme otext)] -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. [a] -> NodeF lexeme a
ExternC ([Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
decls)
        CompoundStmt [Node (Lexeme itext)]
stmts ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Node (Lexeme otext)] -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. [a] -> NodeF lexeme a
CompoundStmt ([Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
stmts)
        NodeF (Lexeme itext) (Node (Lexeme itext))
Break ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (NodeF (Lexeme otext) (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. NodeF lexeme a
Break)
        Goto Lexeme itext
label ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
Goto (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
label)
        NodeF (Lexeme itext) (Node (Lexeme itext))
Continue ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (NodeF (Lexeme otext) (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. NodeF lexeme a
Continue)
        Return Maybe (Node (Lexeme itext))
value ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Maybe (Node (Lexeme otext))
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. Maybe a -> NodeF lexeme a
Return (Maybe (Node (Lexeme otext))
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Maybe (Node (Lexeme otext)))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Node (Lexeme itext))
-> f (Mapped itext otext (Maybe (Node (Lexeme itext))))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Maybe (Node (Lexeme itext))
value)
        SwitchStmt Node (Lexeme itext)
value [Node (Lexeme itext)]
cases ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> [Node (Lexeme otext)]
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> [a] -> NodeF lexeme a
SwitchStmt (Node (Lexeme otext)
 -> [Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f ([Node (Lexeme otext)]
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
value f ([Node (Lexeme otext)]
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
cases)
        IfStmt Node (Lexeme itext)
cond Node (Lexeme itext)
thenStmts Maybe (Node (Lexeme itext))
elseStmt ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> Maybe (Node (Lexeme otext))
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> Maybe a -> NodeF lexeme a
IfStmt (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> Maybe (Node (Lexeme otext))
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> Maybe (Node (Lexeme otext))
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
cond f (Node (Lexeme otext)
   -> Maybe (Node (Lexeme otext))
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Maybe (Node (Lexeme otext))
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
thenStmts f (Maybe (Node (Lexeme otext))
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Maybe (Node (Lexeme otext)))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe (Node (Lexeme itext))
-> f (Mapped itext otext (Maybe (Node (Lexeme itext))))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Maybe (Node (Lexeme itext))
elseStmt)
        ForStmt Node (Lexeme itext)
initStmt Node (Lexeme itext)
cond Node (Lexeme itext)
next Node (Lexeme itext)
stmts ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> a -> a -> NodeF lexeme a
ForStmt (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> Node (Lexeme otext)
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
initStmt f (Node (Lexeme otext)
   -> Node (Lexeme otext)
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
cond f (Node (Lexeme otext)
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
next f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
stmts)
        WhileStmt Node (Lexeme itext)
cond Node (Lexeme itext)
stmts ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
WhileStmt (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
cond f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
stmts)
        DoWhileStmt Node (Lexeme itext)
stmts Node (Lexeme itext)
cond ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
DoWhileStmt (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
stmts f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
cond)
        Case Node (Lexeme itext)
value Node (Lexeme itext)
stmt ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
Case (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
value f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
stmt)
        Default Node (Lexeme itext)
stmt ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> NodeF lexeme a
Default (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
stmt)
        Label Lexeme itext
label Node (Lexeme itext)
stmt ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> a -> NodeF lexeme a
Label (Lexeme otext
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
label f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
stmt)
        VLA Node (Lexeme itext)
ty Lexeme itext
name Node (Lexeme itext)
size ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Lexeme otext
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> lexeme -> a -> NodeF lexeme a
VLA (Node (Lexeme otext)
 -> Lexeme otext
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Lexeme otext
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Lexeme otext
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
size)
        VarDecl Node (Lexeme itext)
ty Node (Lexeme itext)
decl ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
VarDecl (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
decl)
        Declarator Node (Lexeme itext)
spec Maybe (Node (Lexeme itext))
value ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Maybe (Node (Lexeme otext))
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> Maybe a -> NodeF lexeme a
Declarator (Node (Lexeme otext)
 -> Maybe (Node (Lexeme otext))
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Maybe (Node (Lexeme otext))
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
spec f (Maybe (Node (Lexeme otext))
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Maybe (Node (Lexeme otext)))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe (Node (Lexeme itext))
-> f (Mapped itext otext (Maybe (Node (Lexeme itext))))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Maybe (Node (Lexeme itext))
value)
        DeclSpecVar Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
DeclSpecVar (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        DeclSpecArray Node (Lexeme itext)
spec Maybe (Node (Lexeme itext))
size ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Maybe (Node (Lexeme otext))
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> Maybe a -> NodeF lexeme a
DeclSpecArray (Node (Lexeme otext)
 -> Maybe (Node (Lexeme otext))
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Maybe (Node (Lexeme otext))
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
spec f (Maybe (Node (Lexeme otext))
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Maybe (Node (Lexeme otext)))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe (Node (Lexeme itext))
-> f (Mapped itext otext (Maybe (Node (Lexeme itext))))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Maybe (Node (Lexeme itext))
size)
        InitialiserList [Node (Lexeme itext)]
values ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Node (Lexeme otext)] -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. [a] -> NodeF lexeme a
InitialiserList ([Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
values)
        UnaryExpr UnaryOp
op Node (Lexeme itext)
expr ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (UnaryOp
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. UnaryOp -> a -> NodeF lexeme a
UnaryExpr UnaryOp
op (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        BinaryExpr Node (Lexeme itext)
lhs BinaryOp
op Node (Lexeme itext)
rhs ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> BinaryOp
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> BinaryOp -> a -> NodeF lexeme a
BinaryExpr (Node (Lexeme otext)
 -> BinaryOp
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (BinaryOp
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
lhs f (BinaryOp
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f BinaryOp
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> BinaryOp -> f BinaryOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure BinaryOp
op f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
rhs)
        TernaryExpr Node (Lexeme itext)
cond Node (Lexeme itext)
thenExpr Node (Lexeme itext)
elseExpr ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> a -> NodeF lexeme a
TernaryExpr (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
cond f (Node (Lexeme otext)
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
thenExpr f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
elseExpr)
        AssignExpr Node (Lexeme itext)
lhs AssignOp
op Node (Lexeme itext)
rhs ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> AssignOp
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> AssignOp -> a -> NodeF lexeme a
AssignExpr (Node (Lexeme otext)
 -> AssignOp
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (AssignOp
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
lhs f (AssignOp
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f AssignOp
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> AssignOp -> f AssignOp
forall (f :: * -> *) a. Applicative f => a -> f a
pure AssignOp
op f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
rhs)
        ParenExpr Node (Lexeme itext)
expr ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> NodeF lexeme a
ParenExpr (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        CastExpr Node (Lexeme itext)
ty Node (Lexeme itext)
expr ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
CastExpr (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        CompoundExpr Node (Lexeme itext)
ty Node (Lexeme itext)
expr ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
CompoundExpr (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        SizeofExpr Node (Lexeme itext)
expr ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> NodeF lexeme a
SizeofExpr (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        SizeofType Node (Lexeme itext)
ty ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> NodeF lexeme a
SizeofType (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty)
        LiteralExpr LiteralType
ty Lexeme itext
value ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (LiteralType
-> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. LiteralType -> lexeme -> NodeF lexeme a
LiteralExpr LiteralType
ty (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
value)
        VarExpr Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
VarExpr (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        MemberAccess Node (Lexeme itext)
name Lexeme itext
field ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> lexeme -> NodeF lexeme a
MemberAccess (Node (Lexeme otext)
 -> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
name f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
field)
        PointerAccess Node (Lexeme itext)
name Lexeme itext
field ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> lexeme -> NodeF lexeme a
PointerAccess (Node (Lexeme otext)
 -> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
name f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
field)
        ArrayAccess Node (Lexeme itext)
arr Node (Lexeme itext)
idx ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
ArrayAccess (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
arr f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
idx)
        FunctionCall Node (Lexeme itext)
callee [Node (Lexeme itext)]
args ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> [Node (Lexeme otext)]
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> [a] -> NodeF lexeme a
FunctionCall (Node (Lexeme otext)
 -> [Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f ([Node (Lexeme otext)]
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
callee f ([Node (Lexeme otext)]
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
args)
        CommentExpr Node (Lexeme itext)
comment Node (Lexeme itext)
expr ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
CommentExpr (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
comment f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        EnumConsts Maybe (Lexeme itext)
name [Node (Lexeme itext)]
members ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Maybe (Lexeme otext)
-> [Node (Lexeme otext)]
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. Maybe lexeme -> [a] -> NodeF lexeme a
EnumConsts (Maybe (Lexeme otext)
 -> [Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Maybe (Lexeme otext))
-> f ([Node (Lexeme otext)]
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Lexeme itext)
-> f (Mapped itext otext (Maybe (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Maybe (Lexeme itext)
name f ([Node (Lexeme otext)]
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
members)
        EnumDecl Lexeme itext
name [Node (Lexeme itext)]
members Lexeme itext
tyName ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Node (Lexeme otext)]
-> Lexeme otext
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> [a] -> lexeme -> NodeF lexeme a
EnumDecl (Lexeme otext
 -> [Node (Lexeme otext)]
 -> Lexeme otext
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Node (Lexeme otext)]
      -> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f ([Node (Lexeme otext)]
   -> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
members f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
tyName)
        Enumerator Lexeme itext
name Maybe (Node (Lexeme itext))
value ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> Maybe (Node (Lexeme otext))
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> Maybe a -> NodeF lexeme a
Enumerator (Lexeme otext
 -> Maybe (Node (Lexeme otext))
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (Maybe (Node (Lexeme otext))
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f (Maybe (Node (Lexeme otext))
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Maybe (Node (Lexeme otext)))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe (Node (Lexeme itext))
-> f (Mapped itext otext (Maybe (Node (Lexeme itext))))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Maybe (Node (Lexeme itext))
value)
        Typedef Node (Lexeme itext)
ty Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> lexeme -> NodeF lexeme a
Typedef (Node (Lexeme otext)
 -> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        TypedefFunction Node (Lexeme itext)
ty ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> NodeF lexeme a
TypedefFunction (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty)
        Struct Lexeme itext
name [Node (Lexeme itext)]
members ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Node (Lexeme otext)]
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> [a] -> NodeF lexeme a
Struct (Lexeme otext
 -> [Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Node (Lexeme otext)]
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f ([Node (Lexeme otext)]
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
members)
        Union Lexeme itext
name [Node (Lexeme itext)]
members ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Node (Lexeme otext)]
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> [a] -> NodeF lexeme a
Union (Lexeme otext
 -> [Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Node (Lexeme otext)]
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f ([Node (Lexeme otext)]
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
members)
        MemberDecl Node (Lexeme itext)
ty Node (Lexeme itext)
decl Maybe (Lexeme itext)
width ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> Maybe (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> Maybe lexeme -> NodeF lexeme a
MemberDecl (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> Maybe (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> Maybe (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Node (Lexeme otext)
   -> Maybe (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Maybe (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
decl f (Maybe (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Maybe (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Maybe (Lexeme itext)
-> f (Mapped itext otext (Maybe (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Maybe (Lexeme itext)
width)
        TyConst Node (Lexeme itext)
ty ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> NodeF lexeme a
TyConst (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty)
        TyPointer Node (Lexeme itext)
ty ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> NodeF lexeme a
TyPointer (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty)
        TyStruct Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
TyStruct (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        TyFunc Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
TyFunc (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        TyStd Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
TyStd (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        TyUserDefined Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> NodeF lexeme a
TyUserDefined (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        FunctionDecl Scope
scope Node (Lexeme itext)
proto ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Scope
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. Scope -> a -> NodeF lexeme a
FunctionDecl Scope
scope (Node (Lexeme otext) -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
proto)
        FunctionDefn Scope
scope Node (Lexeme itext)
proto Node (Lexeme itext)
body ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Scope
-> Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. Scope -> a -> a -> NodeF lexeme a
FunctionDefn Scope
scope (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
proto f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
body)
        FunctionPrototype Node (Lexeme itext)
ty Lexeme itext
name [Node (Lexeme itext)]
params ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Lexeme otext
-> [Node (Lexeme otext)]
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> lexeme -> [a] -> NodeF lexeme a
FunctionPrototype (Node (Lexeme otext)
 -> Lexeme otext
 -> [Node (Lexeme otext)]
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Lexeme otext
      -> [Node (Lexeme otext)]
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Lexeme otext
   -> [Node (Lexeme otext)]
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Node (Lexeme otext)]
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f ([Node (Lexeme otext)]
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [Node (Lexeme otext)]
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
params)
        FunctionParam Node (Lexeme itext)
ty Node (Lexeme itext)
decl ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> a -> NodeF lexeme a
FunctionParam (Node (Lexeme otext)
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
decl)
        NodeF (Lexeme itext) (Node (Lexeme itext))
Ellipsis ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (NodeF (Lexeme otext) (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a. Applicative f => a -> f a
pure NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. NodeF lexeme a
Ellipsis)
        ConstDecl Node (Lexeme itext)
ty Lexeme itext
name ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Node (Lexeme otext)
-> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> lexeme -> NodeF lexeme a
ConstDecl (Node (Lexeme otext)
 -> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        ConstDefn Scope
scope Node (Lexeme itext)
ty Lexeme itext
name Node (Lexeme itext)
value ->
            NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Scope
-> Node (Lexeme otext)
-> Lexeme otext
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. Scope -> a -> lexeme -> a -> NodeF lexeme a
ConstDefn Scope
scope (Node (Lexeme otext)
 -> Lexeme otext
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (Lexeme otext
      -> Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
ty f (Lexeme otext
   -> Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Lexeme otext)
-> f (Node (Lexeme otext)
      -> NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Lexeme itext
name f (Node (Lexeme otext)
   -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Node (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a.
TraverseAst itext otext a =>
a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
value)

      where
        recurse :: TraverseAst itext otext a => a -> f (Mapped itext otext a)
        recurse :: a -> f (Mapped itext otext a)
recurse = AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
forall itext otext a (f :: * -> *).
(TraverseAst itext otext a, Applicative f) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile

instance TraverseAst itext otext [Node (Lexeme itext)] where
    type Mapped itext otext [Node (Lexeme itext)]
                          = [Node (Lexeme otext)]
    mapFileAst :: AstActions f itext otext
-> FilePath
-> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
mapFileAst actions :: AstActions f itext otext
actions@AstActions{FilePath -> itext -> f otext
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
[(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
(FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doText :: FilePath -> itext -> f otext
doLexeme :: FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
doNode :: FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
doText :: forall (f :: * -> *) itext otext.
AstActions f itext otext -> FilePath -> itext -> f otext
doLexeme :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Lexeme itext]
-> f [Lexeme otext]
-> f [Lexeme otext]
doNode :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
..} FilePath
currentFile = FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doNodes FilePath
currentFile ([Node (Lexeme itext)]
 -> f [Node (Lexeme otext)] -> f [Node (Lexeme otext)])
-> ([Node (Lexeme itext)] -> f [Node (Lexeme otext)])
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
        (Node (Lexeme itext) -> f (Node (Lexeme otext)))
-> [Node (Lexeme itext)] -> f [Node (Lexeme otext)]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (AstActions f itext otext
-> FilePath
-> Node (Lexeme itext)
-> f (Mapped itext otext (Node (Lexeme itext)))
forall itext otext a (f :: * -> *).
(TraverseAst itext otext a, Applicative f) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile)

instance TraverseAst itext otext (FilePath, [Node (Lexeme itext)]) where
    type Mapped itext otext (FilePath, [Node (Lexeme itext)])
                          = (FilePath, [Node (Lexeme otext)])
    mapFileAst :: AstActions f itext otext
-> FilePath
-> (FilePath, [Node (Lexeme itext)])
-> f (Mapped itext otext (FilePath, [Node (Lexeme itext)]))
mapFileAst actions :: AstActions f itext otext
actions@AstActions{FilePath -> itext -> f otext
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
[(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
(FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doText :: FilePath -> itext -> f otext
doLexeme :: FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
doNode :: FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
doText :: forall (f :: * -> *) itext otext.
AstActions f itext otext -> FilePath -> itext -> f otext
doLexeme :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Lexeme itext]
-> f [Lexeme otext]
-> f [Lexeme otext]
doNode :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
..} FilePath
_ tu :: (FilePath, [Node (Lexeme itext)])
tu@(FilePath
currentFile, [Node (Lexeme itext)]
_) = (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFile ((FilePath, [Node (Lexeme itext)])
 -> f (FilePath, [Node (Lexeme otext)])
 -> f (FilePath, [Node (Lexeme otext)]))
-> ((FilePath, [Node (Lexeme itext)])
    -> f (FilePath, [Node (Lexeme otext)]))
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
        ([Node (Lexeme itext)] -> f [Node (Lexeme otext)])
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (AstActions f itext otext
-> FilePath
-> [Node (Lexeme itext)]
-> f (Mapped itext otext [Node (Lexeme itext)])
forall itext otext a (f :: * -> *).
(TraverseAst itext otext a, Applicative f) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile) ((FilePath, [Node (Lexeme itext)])
 -> f (FilePath, [Node (Lexeme otext)]))
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
forall a b. (a -> b) -> a -> b
$ (FilePath, [Node (Lexeme itext)])
tu

instance TraverseAst itext otext [(FilePath, [Node (Lexeme itext)])] where
    type Mapped itext otext [(FilePath, [Node (Lexeme itext)])]
                          = [(FilePath, [Node (Lexeme otext)])]
    mapFileAst :: AstActions f itext otext
-> FilePath
-> [(FilePath, [Node (Lexeme itext)])]
-> f (Mapped itext otext [(FilePath, [Node (Lexeme itext)])])
mapFileAst actions :: AstActions f itext otext
actions@AstActions{FilePath -> itext -> f otext
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
[(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
(FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doText :: FilePath -> itext -> f otext
doLexeme :: FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
doNode :: FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
doText :: forall (f :: * -> *) itext otext.
AstActions f itext otext -> FilePath -> itext -> f otext
doLexeme :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath -> Lexeme itext -> f (Lexeme otext) -> f (Lexeme otext)
doLexemes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Lexeme itext]
-> f [Lexeme otext]
-> f [Lexeme otext]
doNode :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Node (Lexeme itext)
-> f (Node (Lexeme otext))
-> f (Node (Lexeme otext))
doNodes :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
doFile :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> (FilePath, [Node (Lexeme itext)])
-> f (FilePath, [Node (Lexeme otext)])
-> f (FilePath, [Node (Lexeme otext)])
doFiles :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
..} FilePath
currentFile = [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
doFiles ([(FilePath, [Node (Lexeme itext)])]
 -> f [(FilePath, [Node (Lexeme otext)])]
 -> f [(FilePath, [Node (Lexeme otext)])])
-> ([(FilePath, [Node (Lexeme itext)])]
    -> f [(FilePath, [Node (Lexeme otext)])])
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
        ((FilePath, [Node (Lexeme itext)])
 -> f (FilePath, [Node (Lexeme otext)]))
-> [(FilePath, [Node (Lexeme itext)])]
-> f [(FilePath, [Node (Lexeme otext)])]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse (AstActions f itext otext
-> FilePath
-> (FilePath, [Node (Lexeme itext)])
-> f (Mapped itext otext (FilePath, [Node (Lexeme itext)]))
forall itext otext a (f :: * -> *).
(TraverseAst itext otext a, Applicative f) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile)