{-# LANGUAGE RecordWildCards #-}
module Retrie
(
runScript
, runScriptWithModifiedOptions
, parseImports
, parseQueries
, QuerySpec(..)
, parseRewrites
, RewriteSpec(..)
, QualifiedName
, Retrie
, apply
, applyWithStrategy
, applyWithUpdate
, applyWithUpdateAndStrategy
, addImports
, ifChanged
, iterateR
, focus
, query
, queryWithUpdate
, bottomUp
, topDown
, topDownPrune
, MatchResultTransformer
, defaultTransformer
, MatchResult(..)
, Annotated
, astA
, AnnotatedHsDecl
, AnnotatedHsExpr
, AnnotatedHsType
, AnnotatedImports
, AnnotatedModule
, AnnotatedPat
, AnnotatedStmt
, LibDir
, parseDecl
, parseExpr
, parsePattern
, parseStmt
, parseType
, transformA
, graftA
, pruneA
, trimA
, printA
, module Retrie.Expr
, Context(..)
, ContextUpdater
, updateContext
, Options
, Options_(..)
, Verbosity(..)
, module Retrie.Quantifiers
, Query(..)
, Rewrite
, Template(..)
, mkRewrite
, ppRewrite
, addRewriteImports
, setRewriteTransformer
, subst
, module Retrie.Substitution
, Universe
, Matchable(..)
, toURewrite
, fromURewrite
, module Retrie.GHC
) where
import Retrie.Context
import Retrie.ExactPrint.Annotated hiding (unsafeMkA)
import Retrie.ExactPrint
import Retrie.Expr
import Retrie.Fixity
import Retrie.GHC
import Retrie.Monad
import Retrie.Options
import Retrie.Quantifiers
import Retrie.Query
( QuerySpec(..)
, parseQuerySpecs
)
import Retrie.Rewrites
import Retrie.Run
import Retrie.Subst
import Retrie.Substitution
import Retrie.SYB
import Retrie.Types
import Retrie.Universe
import Retrie.Util
parseRewrites :: LibDir -> Options -> [RewriteSpec] -> IO [Rewrite Universe]
parseRewrites :: LibDir -> Options -> [RewriteSpec] -> IO [Rewrite Universe]
parseRewrites = LibDir -> Options -> [RewriteSpec] -> IO [Rewrite Universe]
LibDir
-> Options_
[Rewrite Universe]
(Annotated [GenLocated SrcSpanAnnA (ImportDecl GhcPs)])
-> [RewriteSpec]
-> IO [Rewrite Universe]
forall a b.
LibDir -> Options_ a b -> [RewriteSpec] -> IO [Rewrite Universe]
parseRewritesInternal
parseQueries
:: LibDir -> Options -> [(Quantifiers, QuerySpec, v)] -> IO [Query Universe v]
parseQueries :: forall v.
LibDir
-> Options
-> [(Quantifiers, QuerySpec, v)]
-> IO [Query Universe v]
parseQueries LibDir
libdir Options{Bool
Int
LibDir
[LibDir]
[Rewrite Universe]
[RoundTrip]
FixityEnv
AnnotatedImports
Verbosity
ExecutionMode
ColoriseFun
additionalImports :: AnnotatedImports
colorise :: ColoriseFun
elaborations :: [Rewrite Universe]
executionMode :: ExecutionMode
extraIgnores :: [LibDir]
fixityEnv :: FixityEnv
iterateN :: Int
noDefaultElaborations :: Bool
randomOrder :: Bool
rewrites :: [Rewrite Universe]
roundtrips :: [RoundTrip]
singleThreaded :: Bool
targetDir :: LibDir
targetFiles :: [LibDir]
verbosity :: Verbosity
additionalImports :: forall rewrites imports. Options_ rewrites imports -> imports
colorise :: forall rewrites imports. Options_ rewrites imports -> ColoriseFun
elaborations :: forall rewrites imports. Options_ rewrites imports -> rewrites
executionMode :: forall rewrites imports. Options_ rewrites imports -> ExecutionMode
extraIgnores :: forall rewrites imports. Options_ rewrites imports -> [LibDir]
fixityEnv :: forall rewrites imports. Options_ rewrites imports -> FixityEnv
iterateN :: forall rewrites imports. Options_ rewrites imports -> Int
noDefaultElaborations :: forall rewrites imports. Options_ rewrites imports -> Bool
randomOrder :: forall rewrites imports. Options_ rewrites imports -> Bool
rewrites :: forall rewrites imports. Options_ rewrites imports -> rewrites
roundtrips :: forall rewrites imports. Options_ rewrites imports -> [RoundTrip]
singleThreaded :: forall rewrites imports. Options_ rewrites imports -> Bool
targetDir :: forall rewrites imports. Options_ rewrites imports -> LibDir
targetFiles :: forall rewrites imports. Options_ rewrites imports -> [LibDir]
verbosity :: forall rewrites imports. Options_ rewrites imports -> Verbosity
..} = LibDir
-> FixityEnv
-> [(Quantifiers, QuerySpec, v)]
-> IO [Query Universe v]
forall v.
LibDir
-> FixityEnv
-> [(Quantifiers, QuerySpec, v)]
-> IO [Query Universe v]
parseQuerySpecs LibDir
libdir FixityEnv
fixityEnv