{-# LANGUAGE FlexibleContexts      #-}
{-# LANGUAGE FlexibleInstances     #-}
{-# LANGUAGE InstanceSigs          #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards       #-}
{-# LANGUAGE ScopedTypeVariables   #-}
{-# LANGUAGE Strict                #-}
{-# LANGUAGE TypeFamilies          #-}
module Language.Cimple.MapAst
    ( mapAst, mapFileAst

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

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

import           Data.Fix              (Fix (..))
import           GHC.Stack             (HasCallStack)
import           Language.Cimple.Ast   (Comment, CommentF (..), Node,
                                        NodeF (..))
import           Language.Cimple.Lexer (Lexeme (..))

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

mapAst
    :: (MapAst itext otext a, Applicative f, HasCallStack)
    => AstActions f itext otext -> a
    -> f    (Mapped itext otext    a)
mapAst :: AstActions f itext otext -> a -> f (Mapped itext otext a)
mapAst = (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 :: * -> *).
(MapAst itext otext a, Applicative f, HasCallStack) =>
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
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (Lexeme otext))
doComment   :: FilePath ->  Comment (Lexeme itext)    -> f             (Comment (Lexeme otext))   -> f             (Comment (Lexeme otext))
    , AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComments  :: FilePath -> [Comment (Lexeme itext)]   -> f             [Comment (Lexeme otext)]   -> f             [Comment (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 MapAst itext otext        a
      => MapAst 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 :: * -> *).
(MapAst itext otext a, Applicative f, HasCallStack) =>
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
    -> Comment (Lexeme itext)
    -> f (Comment (Lexeme otext))
    -> f (Comment (Lexeme otext)))
-> (FilePath
    -> [Comment (Lexeme itext)]
    -> f [Comment (Lexeme otext)]
    -> f [Comment (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
    , doComment :: FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (Lexeme otext))
doComment   = (Comment (Lexeme itext)
 -> f (Comment (Lexeme otext)) -> f (Comment (Lexeme otext)))
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (Lexeme otext))
forall a b. a -> b -> a
const ((Comment (Lexeme itext)
  -> f (Comment (Lexeme otext)) -> f (Comment (Lexeme otext)))
 -> FilePath
 -> Comment (Lexeme itext)
 -> f (Comment (Lexeme otext))
 -> f (Comment (Lexeme otext)))
-> (Comment (Lexeme itext)
    -> f (Comment (Lexeme otext)) -> f (Comment (Lexeme otext)))
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (Lexeme otext))
forall a b. (a -> b) -> a -> b
$ (f (Comment (Lexeme otext)) -> f (Comment (Lexeme otext)))
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (Lexeme otext))
forall a b. a -> b -> a
const f (Comment (Lexeme otext)) -> f (Comment (Lexeme otext))
forall a. a -> a
id
    , doComments :: FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComments  = ([Comment (Lexeme itext)]
 -> f [Comment (Lexeme otext)] -> f [Comment (Lexeme otext)])
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
forall a b. a -> b -> a
const (([Comment (Lexeme itext)]
  -> f [Comment (Lexeme otext)] -> f [Comment (Lexeme otext)])
 -> FilePath
 -> [Comment (Lexeme itext)]
 -> f [Comment (Lexeme otext)]
 -> f [Comment (Lexeme otext)])
-> ([Comment (Lexeme itext)]
    -> f [Comment (Lexeme otext)] -> f [Comment (Lexeme otext)])
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
forall a b. (a -> b) -> a -> b
$ (f [Comment (Lexeme otext)] -> f [Comment (Lexeme otext)])
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
forall a b. a -> b -> a
const f [Comment (Lexeme otext)] -> f [Comment (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 MapAst itext otext (Lexeme itext) where
    type Mapped itext otext (Lexeme itext)
                          =  Lexeme otext
    mapFileAst :: (Applicative f, HasCallStack)
               => 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
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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 MapAst 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
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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 :: * -> *).
(MapAst itext otext a, Applicative f, HasCallStack) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile)

instance MapAst itext otext (Comment (Lexeme itext)) where
    type Mapped itext otext (Comment (Lexeme itext))
                          =  Comment (Lexeme otext)
    mapFileAst
        :: forall f. (Applicative f, HasCallStack)
        => AstActions f itext otext
        -> FilePath
        ->    Comment (Lexeme itext)
        -> f (Comment (Lexeme otext))
    mapFileAst :: AstActions f itext otext
-> FilePath -> Comment (Lexeme itext) -> f (Comment (Lexeme otext))
mapFileAst actions :: AstActions f itext otext
actions@AstActions{FilePath -> itext -> f otext
FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (Lexeme otext))
doComment FilePath
currentFile (Comment (Lexeme itext)
 -> f (Comment (Lexeme otext)) -> f (Comment (Lexeme otext)))
-> (Comment (Lexeme itext) -> f (Comment (Lexeme otext)))
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> \Comment (Lexeme itext)
comment -> case Comment (Lexeme itext)
-> CommentF (Lexeme itext) (Comment (Lexeme itext))
forall (f :: * -> *). Fix f -> f (Fix f)
unFix Comment (Lexeme itext)
comment of
        DocComment [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> CommentF lexeme a
DocComment ([Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocWord Lexeme itext
word ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. lexeme -> CommentF lexeme a
DocWord (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
word)
        DocSentence [Comment (Lexeme itext)]
docs Lexeme itext
ending ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> lexeme -> CommentF lexeme a
DocSentence ([Comment (Lexeme otext)]
 -> Lexeme otext
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (Lexeme otext
      -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs f (Lexeme otext
   -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f (CommentF (Lexeme otext) (Comment (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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
ending)
        CommentF (Lexeme itext) (Comment (Lexeme itext))
DocNewline -> Comment (Lexeme otext) -> f (Comment (Lexeme otext))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Comment (Lexeme otext) -> f (Comment (Lexeme otext)))
-> Comment (Lexeme otext) -> f (Comment (Lexeme otext))
forall a b. (a -> b) -> a -> b
$ CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. CommentF lexeme a
DocNewline

        DocAttention [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> CommentF lexeme a
DocAttention ([Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocBrief [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> CommentF lexeme a
DocBrief ([Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocDeprecated [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> CommentF lexeme a
DocDeprecated ([Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocExtends Lexeme itext
feat ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. lexeme -> CommentF lexeme a
DocExtends (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
feat)
        DocImplements Lexeme itext
feat ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. lexeme -> CommentF lexeme a
DocImplements (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
feat)
        DocParam Maybe (Lexeme itext)
attr Lexeme itext
name [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Maybe (Lexeme otext)
-> Lexeme otext
-> [Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. Maybe lexeme -> lexeme -> [a] -> CommentF lexeme a
DocParam (Maybe (Lexeme otext)
 -> Lexeme otext
 -> [Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Maybe (Lexeme otext))
-> f (Lexeme otext
      -> [Comment (Lexeme otext)]
      -> CommentF (Lexeme otext) (Comment (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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Maybe (Lexeme itext)
attr f (Lexeme otext
   -> [Comment (Lexeme otext)]
   -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Comment (Lexeme otext)]
      -> CommentF (Lexeme otext) (Comment (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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
name f ([Comment (Lexeme otext)]
   -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocReturn [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> CommentF lexeme a
DocReturn ([Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocRetval Lexeme itext
expr [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. lexeme -> [a] -> CommentF lexeme a
DocRetval (Lexeme otext
 -> [Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Comment (Lexeme otext)]
      -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
expr f ([Comment (Lexeme otext)]
   -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocSee Lexeme itext
ref [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. lexeme -> [a] -> CommentF lexeme a
DocSee (Lexeme otext
 -> [Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Comment (Lexeme otext)]
      -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
ref f ([Comment (Lexeme otext)]
   -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)

        CommentF (Lexeme itext) (Comment (Lexeme itext))
DocPrivate -> Comment (Lexeme otext) -> f (Comment (Lexeme otext))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Comment (Lexeme otext) -> f (Comment (Lexeme otext)))
-> Comment (Lexeme otext) -> f (Comment (Lexeme otext))
forall a b. (a -> b) -> a -> b
$ CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. CommentF lexeme a
DocPrivate

        DocParagraph [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> CommentF lexeme a
DocParagraph ([Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocLine [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> CommentF lexeme a
DocLine ([Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocList [Comment (Lexeme itext)]
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> CommentF lexeme a
DocList ([Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs)
        DocOLItem Lexeme itext
docs [Comment (Lexeme itext)]
sublist ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext
-> [Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. lexeme -> [a] -> CommentF lexeme a
DocOLItem (Lexeme otext
 -> [Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f ([Comment (Lexeme otext)]
      -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
docs f ([Comment (Lexeme otext)]
   -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
sublist)
        DocULItem [Comment (Lexeme itext)]
docs [Comment (Lexeme itext)]
sublist ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> ([Comment (Lexeme otext)]
-> [Comment (Lexeme otext)]
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. [a] -> [a] -> CommentF lexeme a
DocULItem ([Comment (Lexeme otext)]
 -> [Comment (Lexeme otext)]
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f ([Comment (Lexeme otext)]
      -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
docs f ([Comment (Lexeme otext)]
   -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f [Comment (Lexeme otext)]
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Comment (Lexeme itext)]
sublist)

        DocColon Lexeme itext
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. lexeme -> CommentF lexeme a
DocColon (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
docs)
        DocRef Lexeme itext
doc ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. lexeme -> CommentF lexeme a
DocRef (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
doc)
        DocP Lexeme itext
doc ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. lexeme -> CommentF lexeme a
DocP (Lexeme otext -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Lexeme otext)
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
doc)
        DocLParen Comment (Lexeme itext)
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Comment (Lexeme otext)
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. a -> CommentF lexeme a
DocLParen (Comment (Lexeme otext)
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Comment (Lexeme itext)
-> f (Mapped itext otext (Comment (Lexeme itext)))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Comment (Lexeme itext)
docs)
        DocRParen Comment (Lexeme itext)
docs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Comment (Lexeme otext)
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. a -> CommentF lexeme a
DocRParen (Comment (Lexeme otext)
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Comment (Lexeme itext)
-> f (Mapped itext otext (Comment (Lexeme itext)))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Comment (Lexeme itext)
docs)
        DocAssignOp AssignOp
op Comment (Lexeme itext)
lhs Comment (Lexeme itext)
rhs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (AssignOp
-> Comment (Lexeme otext)
-> Comment (Lexeme otext)
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. AssignOp -> a -> a -> CommentF lexeme a
DocAssignOp AssignOp
op (Comment (Lexeme otext)
 -> Comment (Lexeme otext)
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
-> f (Comment (Lexeme otext)
      -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Comment (Lexeme itext)
-> f (Mapped itext otext (Comment (Lexeme itext)))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Comment (Lexeme itext)
lhs f (Comment (Lexeme otext)
   -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Comment (Lexeme itext)
-> f (Mapped itext otext (Comment (Lexeme itext)))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Comment (Lexeme itext)
rhs)
        DocBinaryOp BinaryOp
op Comment (Lexeme itext)
lhs Comment (Lexeme itext)
rhs ->
            CommentF (Lexeme otext) (Comment (Lexeme otext))
-> Comment (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix (CommentF (Lexeme otext) (Comment (Lexeme otext))
 -> Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (BinaryOp
-> Comment (Lexeme otext)
-> Comment (Lexeme otext)
-> CommentF (Lexeme otext) (Comment (Lexeme otext))
forall lexeme a. BinaryOp -> a -> a -> CommentF lexeme a
DocBinaryOp BinaryOp
op (Comment (Lexeme otext)
 -> Comment (Lexeme otext)
 -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
-> f (Comment (Lexeme otext)
      -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Comment (Lexeme itext)
-> f (Mapped itext otext (Comment (Lexeme itext)))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Comment (Lexeme itext)
lhs f (Comment (Lexeme otext)
   -> CommentF (Lexeme otext) (Comment (Lexeme otext)))
-> f (Comment (Lexeme otext))
-> f (CommentF (Lexeme otext) (Comment (Lexeme otext)))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Comment (Lexeme itext)
-> f (Mapped itext otext (Comment (Lexeme itext)))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Comment (Lexeme itext)
rhs)

      where
        recurse :: MapAst 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 :: * -> *).
(MapAst itext otext a, Applicative f, HasCallStack) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile

instance MapAst itext otext [Comment (Lexeme itext)] where
    type Mapped itext otext [Comment (Lexeme itext)]
                          = [Comment (Lexeme otext)]
    mapFileAst :: AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f (Mapped itext otext [Comment (Lexeme itext)])
mapFileAst actions :: AstActions f itext otext
actions@AstActions{FilePath -> itext -> f otext
FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComments FilePath
currentFile ([Comment (Lexeme itext)]
 -> f [Comment (Lexeme otext)] -> f [Comment (Lexeme otext)])
-> ([Comment (Lexeme itext)] -> f [Comment (Lexeme otext)])
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*>
        (Comment (Lexeme itext) -> f (Comment (Lexeme otext)))
-> [Comment (Lexeme itext)] -> f [Comment (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
-> Comment (Lexeme itext)
-> f (Mapped itext otext (Comment (Lexeme itext)))
forall itext otext a (f :: * -> *).
(MapAst itext otext a, Applicative f, HasCallStack) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile)


instance MapAst itext otext (Node (Lexeme itext)) where
    type Mapped itext otext (Node (Lexeme itext))
                          =  Node (Lexeme otext)
    mapFileAst
        :: forall f . (Applicative f, HasCallStack)
        => 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
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
end)
        CommentSection Node (Lexeme itext)
start [Node (Lexeme itext)]
decls Node (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
<$> (Node (Lexeme otext)
-> [Node (Lexeme otext)]
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> [a] -> a -> NodeF lexeme a
CommentSection (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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
start 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
end)
        CommentSectionEnd 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
CommentSectionEnd (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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
subject)
        CommentInfo Comment (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
<$> (Comment (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. Comment lexeme -> NodeF lexeme a
CommentInfo (Comment (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (Comment (Lexeme otext))
-> f (NodeF (Lexeme otext) (Node (Lexeme otext)))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Comment (Lexeme itext)
-> f (Mapped itext otext (Comment (Lexeme itext)))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Comment (Lexeme itext)
comment)
        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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
decls)
        Group [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
Group ([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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
stmts)
        NodeF (Lexeme itext) (Node (Lexeme itext))
Break ->
            Node (Lexeme otext) -> f (Node (Lexeme otext))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Node (Lexeme otext) -> f (Node (Lexeme otext)))
-> Node (Lexeme otext) -> f (Node (Lexeme otext))
forall a b. (a -> b) -> a -> b
$ NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
label)
        NodeF (Lexeme itext) (Node (Lexeme itext))
Continue ->
            Node (Lexeme otext) -> f (Node (Lexeme otext))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Node (Lexeme otext) -> f (Node (Lexeme otext)))
-> Node (Lexeme otext) -> f (Node (Lexeme otext))
forall a b. (a -> b) -> a -> b
$ NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
stmt)
        ExprStmt 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
ExprStmt (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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
size)
        VarDeclStmt Node (Lexeme itext)
decl Maybe (Node (Lexeme itext))
ini ->
            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
VarDeclStmt (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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
decl 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Maybe (Node (Lexeme itext))
ini)
        VarDecl Node (Lexeme itext)
ty Lexeme itext
name [Node (Lexeme itext)]
arrs ->
            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
VarDecl (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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
arrs)
        DeclSpecArray 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
<$> (Maybe (Node (Lexeme otext))
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. Maybe a -> NodeF lexeme a
DeclSpecArray (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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        CompoundExpr Node (Lexeme itext)
ty Node (Lexeme itext)
expr -> -- DEPRECATED
            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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
expr)
        CompoundLiteral 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
CompoundLiteral (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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Maybe (Node (Lexeme itext))
value)
        AggregateDecl Node (Lexeme itext)
struct ->
            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
AggregateDecl (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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
struct)
        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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
members)
        MemberDecl Node (Lexeme itext)
decl Maybe (Lexeme itext)
bits ->
            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 (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. a -> Maybe lexeme -> NodeF lexeme a
MemberDecl (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. Functor f => (a -> b) -> f a -> f b
<$> Node (Lexeme itext) -> f (Mapped itext otext (Node (Lexeme itext)))
forall a. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Maybe (Lexeme itext)
bits)
        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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        AttrPrintf Lexeme itext
fmt Lexeme itext
ellipsis Node (Lexeme itext)
fun ->
            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
-> Lexeme otext
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> lexeme -> a -> NodeF lexeme a
AttrPrintf (Lexeme otext
 -> Lexeme otext
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f (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
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
fmt 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
ellipsis 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
fun)
        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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Node (Lexeme itext)]
params)
        CallbackDecl 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
<$> (Lexeme otext
-> Lexeme otext -> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. lexeme -> lexeme -> NodeF lexeme a
CallbackDecl (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. Functor f => (a -> b) -> f a -> f b
<$> Lexeme itext -> f (Mapped itext otext (Lexeme itext))
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Lexeme itext
name)
        NonNull [Lexeme itext]
nonnull [Lexeme itext]
nullable Node (Lexeme itext)
f ->
            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]
-> [Lexeme otext]
-> Node (Lexeme otext)
-> NodeF (Lexeme otext) (Node (Lexeme otext))
forall lexeme a. [lexeme] -> [lexeme] -> a -> NodeF lexeme a
NonNull ([Lexeme otext]
 -> [Lexeme otext]
 -> Node (Lexeme otext)
 -> NodeF (Lexeme otext) (Node (Lexeme otext)))
-> f [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
<$> [Lexeme itext] -> f (Mapped itext otext [Lexeme itext])
forall a. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Lexeme itext]
nonnull 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse [Lexeme itext]
nullable 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
f)
        NodeF (Lexeme itext) (Node (Lexeme itext))
Ellipsis ->
            Node (Lexeme otext) -> f (Node (Lexeme otext))
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Node (Lexeme otext) -> f (Node (Lexeme otext)))
-> Node (Lexeme otext) -> f (Node (Lexeme otext))
forall a b. (a -> b) -> a -> b
$ NodeF (Lexeme otext) (Node (Lexeme otext)) -> Node (Lexeme otext)
forall (f :: * -> *). f (Fix f) -> Fix f
Fix 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. MapAst 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. MapAst 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. MapAst 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. MapAst 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. MapAst itext otext a => a -> f (Mapped itext otext a)
recurse Node (Lexeme itext)
value)

      where
        recurse :: MapAst 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 :: * -> *).
(MapAst itext otext a, Applicative f, HasCallStack) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile

instance MapAst 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
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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 :: * -> *).
(MapAst itext otext a, Applicative f, HasCallStack) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile)

instance MapAst 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
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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 :: * -> *).
(MapAst itext otext a, Applicative f, HasCallStack) =>
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 MapAst 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
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
FilePath
-> [Node (Lexeme itext)]
-> f [Node (Lexeme otext)]
-> f [Node (Lexeme otext)]
FilePath -> [Lexeme itext] -> f [Lexeme otext] -> f [Lexeme otext]
FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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]
doComments :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> [Comment (Lexeme itext)]
-> f [Comment (Lexeme otext)]
-> f [Comment (Lexeme otext)]
doComment :: forall (f :: * -> *) itext otext.
AstActions f itext otext
-> FilePath
-> Comment (Lexeme itext)
-> f (Comment (Lexeme otext))
-> f (Comment (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 :: * -> *).
(MapAst itext otext a, Applicative f, HasCallStack) =>
AstActions f itext otext
-> FilePath -> a -> f (Mapped itext otext a)
mapFileAst AstActions f itext otext
actions FilePath
currentFile)