~d      !"#$%&'()*+,-./0123456789:; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l mnopqrstuvwxyz{|}~       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcSafe d efghi   d efghiNoneG jklmnopqr jklmnopqrNoneReplacement for original getRichTokenStreamE which will return the tokens for a file processed by CPP. See bug +http://ghc.haskell.org/trac/ghc/ticket/8265sCombine the three sets of tokens to produce a single set that represents the code compiled, and will regenerate the original source file. [ directiveToksf] are the tokens corresponding to preprocessor directives, converted to comments [ origSrcToks] are the tokenised source of the original code, with the preprocessor directives stripped out so that the lexer does not complain [ postCppToksl] are the tokens that the compiler saw originally NOTE: this scheme will only work for cpp in -nomacro modetNStrip out the CPP directives so that the balance of the source can tokenised.u%The preprocessed files are placed in a temporary directory, with a temporary name, and extension .hscpp. Each of these files has three lines at the top identifying the original origin of the files, which is ignored by the later stages of compilation except to contextualise error messages.v?A GHC preprocessed file has the following comments at the top  # 1 ".testtestdata/BCpp.hs" # 1 " command-line " # 1 ".testtestdata/BCpp.hs"  This function reads the first line of the file and returns the string in it. NOTE: no error checking, will blow up if it failswCGet the preprocessor directives as comment tokens from the source.xuMerge two sorted lists using into a single, sorted whole, allowing the programmer to specify the comparison function.QuickCheck test property:prop_mergeBy xs ys = mergeBy cmp (sortBy cmp xs) (sortBy cmp ys) == sortBy cmp (xs ++ ys) where types = xs :: [ (Int, Int) ] cmp (x1,_) (x2,_) = compare x1 x2 sytzu{vw|}~x sytzu{vw|}~xNone'cThe result of a refactoring is the file, a flag as to whether it was modified, and the updated AST(WIdentifies the tree carrying the main tokens, not any work in progress or deleted ones !"#$%&'( !"#$%&'('$%& !"#(  !"#$%&'(None35)oThe PN is the name as it occurs to the parser, and corresponds with the GHC.RdrName type PN = GHC.RdrName+YHsName is a name as it is found in the source This seems to be quite a close correlation:The PNT is the unique name, after GHC renaming. It corresponds to GHC.Name data PNT = PNT GHC.Name deriving (Data,Typeable) -- Note: GHC.Name has SrcLoc in it already)*+,-./0123456789: )*+,-./0110/.-,+)*:98765432)*+,-./0123456789: None (*-3457CN >EProvide some temporary storage while the refactoring is taking placeE]Result of parsing a Haskell source file. It is simply the TypeCheckedModule produced by GHC.IState for refactoring a single file. Holds/hides the ghc-exactprint annotations, which get updated transparently at key points.KSession level settingsL@Current Unique creator value, incremented every time it is usedMACurrent SrcSpan creator value, incremented every time it is usedN)Flags for controlling generic traversalsO:Temporary storage of values while refactoring takes placeQ#The current module being refactoredT+Current traversal has already made a changeXrMapping from the names in the ParsedSource to the renamed versions. Note: No strict mark, can be computed lazily.YIToken stream for the current module, maybe modified, in SrcSpan tree formZ"current module has updated the AST>;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkl2;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijkl2Eabcd]^_`IJKLMNOPQUVWXYZHFG[\RST>?@ABCD;<=gkefhijl ;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklNone*3457INmfetch the final annotationsp For testingYInternal low level interface to access the current annotations from the RefactGhc state.vYInternal low level interface to access the current annotations from the RefactGhc state.YInternal low level interface to access the current annotations from the RefactGhc state.YInternal low level interface to access the current annotations from the RefactGhc state.We need the ParsedSource because it more closely reflects the actual source code, but must be able to work with the renamed representation of the names involved. This function constructs a map from every Located RdrName in the ParsedSource to its corresponding name in the RenamedSource. It also deals with the wrinkle that we need to Location of the RdrName to make sure we have the right Name, but not all RdrNames have a Location. This function is called before the RefactGhc monad is active.'mnopqrstuvwxyz{|}~"mnopqrstuvwxyz{|}~"mnopqrstuvwxzy|}~{'mnopqrstuvwxyz{|}~ None35'gets the (row,col) of the start of the  GHC.SrcSpan, or (-1,-1) if there is an GHC.UnhelpfulSpan%gets the (row,col) of the end of the  GHC.SrcSpan, or (-1,-1) if there is an GHC.UnhelpfulSpanfGet around lack of instance Eq when simply testing for empty list TODO: get rid of this in favour of  built in fn2Get the first SrcSpan found, in top down traversal None None *3457IN ?Extract the module name from the parsed source, if there is one-Parse a single source file into a GHC sessionFor GHC 7.10.2, setting  prevents the pragmas at the top of a source file from being read if there is a comment mixed in them anywhere. To work around this, we need to inject that setting into the cached dynflags in the T before parsing it for refactoring, otherwise all comments will be discarded. See -https://ghc.haskell.org/trac/ghc/ticket/10942ZIn the existing GHC session, put the requested TypeCheckedModule into the RefactGhc monadManage a whole refactor session. Initialise the monad, load the whole project if required, and then apply the individual refactorings, and write out the resulting files.TIt is intended that this forms the umbrella function, in which applyRefac is calledAApply a refactoring (or part of a refactoring) to a single module<Returns True if any of the results has its modified flag set)Write refactored program source to files.Return the client modules and file names. The client modules of module, say m, are those modules which directly or indirectly import module m. Return the server module and file names. The server modules of module, say m, are those modules which are directly or indirectly imported by module m. This can only be called in a live GHC session TODO: make sure this works with multiple targets. Is that needed? No?ghc-mod options>The computation doing the refactoring. Normally created via The refactoring where to get the module and toks { { NoneIN Monadic variation on everywhere' Monadic variation on everywhere'Bottom-up transformation$Top-down version of everywhereStaged>Perform a query on the immediate subterms only, avoiding holesStaged variation of SYB.listify The stage must be provided to avoid trying to modify elements which may not be present at all stages of AST processing.@Apply a generic transformation everywhere in a bottom-up manner.Open a zipper to the point where the Geneneric query passes. returns the original zipper if the query does not pass (check this)~Apply a generic monadic transformation once at the topmost leftmost successful location, avoiding holes in the GHC structures4Transform a zipper opened with a given generic query?Monadic transform of a zipper opened with a given generic query&Climb the tree until a predicate holdsGUp the zipper until a predicate holds, and then return the zipper holeOpen a zipper to the point where the Generic query passes, returning the zipper and a value from the specific part of the GenericQ that matched. This allows the components of the query to return a specific transformation routine, to apply to the returned zipperOpen a zipper to the point where the Generic query passes, and apply the transformation returned from the specific part of the GenericQ that matched.None345IN0Replaces an old expression with a new expression8Shift the first output annotation into the correct placeNone34579NsReturn the binds that are directly enclosed in the given syntax phrase. hsValBinds :: t -> [GHC.LHsBind GHC.Name]Return the type class definitions that are directly enclosed in the given syntax phrase. Note: only makes sense for GHC.RenamedSource31None345N-For declared variablesFor free variablesReturns True is a syntax phrase, say a, is part of another syntax phrase, say b. NOTE: very important: only do a shallow check>Return True if syntax phrases t1 and t2 refer to the same one. True if the name is a field name True if the name is a field name$True if the name is a class instanceCCollect the identifiers (in PName format) in a given syntax phrase.Collect the free and declared variables (in the GHC.Name format) in a given syntax phrase t. In the result, the first list contains the free variables, and the second list contains the declared variables. Expects RenamedSourceCollect the free and declared variables (in the GHC.Name format) in a given syntax phrase t. In the result, the first list contains the free variables, and the second list contains the declared variables. Expects RenamedSource The same as > except that the returned variables are in the String format.Collect the free and declared variables (in the GHC.Name format) in a given syntax phrase t. In the result, the first list contains the free variables, and the second list contains the declared variables. TODO: use GHC.NameSet instead of lists for FreeNames/DeclaredNames NOTE: The GHC fvs fields only carry non-GHC values, as they are used in the renaming process hsFreeAndDeclaredGhc :: (SYB.Data t,GHC.Outputable t)Get the names of all types declared in the given declaration getDeclaredTypesRdr :: GHC.LTyClDecl GHC.RdrName -> RefactGhc [GHC.Name]<Get the names of all types declared in the given declarationXReturn the list of identifiers (in PName format) defined by a function/pattern binding.Find those declarations(function/pattern binding) which define the specified GHC.Names. incTypeSig indicates whether the corresponding type signature will be included.Find those declarations(function/pattern binding) which define the specified GHC.Names. incTypeSig indicates whether the corresponding type signature will be included.Find those declarations(function/pattern binding) which define the specified GHC.Names. incTypeSig indicates whether the corresponding type signature will be included.Find those declarations(function/pattern binding) which define the specified GHC.Names. incTypeSig indicates whether the corresponding type signature will be included.7Find those type signatures for the specified GHC.Names.7Find those type signatures for the specified GHC.Names.=Find those declarations which define the specified GHC.Names.NReturn True if the function/pattern binding defines the specified identifier.NReturn True if the function/pattern binding defines the specified identifier.@Unwraps a LHsDecl and calls definesRdr on the result if a HsBindWReturn True if the declaration defines the type signature of the specified identifier.WReturn True if the declaration defines the type signature of the specified identifier.=Unwraps a LHsDecl and calls definesRdr on the result if a Sig2Find all Located Names in the given Syntax phrase.-Get all the names in the given syntax element-Get all the names in the given syntax elementExperiment with GHC fvs stuffGiven syntax phrases e and t, if e occurs in t, then return those variables which are declared in t and accessible to e, otherwise return [].Same as < except that the returned identifiers are in String format.Same as < except that the returned identifiers are in String format.Given syntax phrases e and t, if e occurs in t, then return those variables which are declared in t and accessible to e, otherwise return [].Given syntax phrases e and t, if e occurs in t, then return those variables which are declared in t and accessible to e, otherwise return [].Given syntax phrases e and t, if e occurs in t, then return those variables which are declared in t and accessible to e, otherwise return []. is different from % in that: given an syntax phrase t,  returns not only the declared variables that are visible from outside of t, but also those declared variables that are visible to the main expression inside t. NOTE: Expects to be given RenamedSource is different from % in that: given an syntax phrase t,  returns not only the declared variables that are visible from outside of t, but also those declared variables that are visible to the main expression inside t. NOTE: Expects to be given RenamedSource The same as = except that the returned variables are in the String format The same as = except that the returned variables are in the String formatFind the identifier(in GHC.Name format) whose start position is (row,col) in the file specified by the fileName, and returns & if such an identifier does not exist.Find the identifier(in GHC.RdrName format) whose start position is (row,col) in the file specified by the fileName, and returns & if such an identifier does not exist.Worker for both locToName and locToRdrName. NOTE: provides for FunBind MatchGroups where only the first name is retained in the ASTMThe specified identifiers.A collection of declarations.)True means to include the type signature.5True means to look at the local declarations as well. The result.The specified identifiers.A collection of declarations. The result.The specified identifiers.A collection of declarations.)True means to include the type signature.5True means to look at the local declarations as well. The result.The specified identifiers.A collection of declarations. The result.The specified identifiers.A collection of declarations. The result.The specified identifiers.A collection of declarations. The result.The specified identifiers.A collection of declarations. The result.The syntax phrase The resultThe row and column numberThe syntax phrase The resultThe row and column numberThe syntax phrase The resultThe row and column numberThe syntax phrase The result==HNone345INJDRepresents the operation type we want to select on addItemsToImport'Used for addHidingUsed for addItemsToImportHReturn True if any of the GHC.Name's appear in the given syntax elementProcess the inscope relation returned from the parsing and module analysis pass, and return a list of four-element tuples. Each tuple contains an identifier name, the identifier's namespace info, the identifier's defining module name and its qualifier name.The same identifier may have multiple entries in the result because it may have different qualifiers. This makes it easier to decide whether the identifier can be used unqualifiedly by just checking whether there is an entry for it with the qualifier field being Nothing.NReturn True if the identifier is inscope and can be used without a qualifier.Return True if the identifier is inscope and can be used without a qualifier. The identifier name string may have a qualifier already NOTE: may require qualification based on name clash with an existing identifier. Return all >s that correspond to the given string, in the current module.Given a  defined in one module, find the equivalent one in the currently loaded module. This is required otherwise name equality checking based on  will fail.Make a simple unqualified NMake a new GHC.Name, using the Unique Int sequence stored in the RefactState. @Create a new name base on the old name. Suppose the old name is f$, then the new name would be like f_i where i is an integer. pReturn True if the current module is exported either by default or by specifying the module name in the export. SReturn True if an identifier is exported by the module currently being refactored. BReturn True if an identifier is explicitly exported by the module.DCheck if the proposed new name will conflict with an existing exportGiven a RenamedSource LPAT, return the equivalent ParsedSource part. NOTE: returns pristine ParsedSource, since HaRe does not change itGiven a RenamedSource Located name, return the equivalent ParsedSource part. NOTE: returns pristine ParsedSource, since HaRe does not change itGiven a RenamedSource Located name, return the equivalent ParsedSource part. NOTE: returns pristine ParsedSource, since HaRe does not change itReturn True if the identifier is unqualifiedly used in the given syntax phrase. usedWithoutQualR :: GHC.Name -> GHC.ParsedSource -> Bool<Return True if a string is a lexically valid variable name.>Return True if a string is a lexically valid constructor name.;Return True if a string is a lexically valid operator name.]Returns True if a string lexically is an identifier. *This function should not be exported.*+Return True if a PName is a toplevel PName.(Return True if a PName is a local PName.Return True if the name has a  GHC.SrcSpan+, i.e. is declared in source we care about?Return True if a PName is a function/pattern name defined in t.Return True if a PName is a qualified PName. AZ:NOTE: this tests the use instance, the underlying name may be qualified. e.g. used name is zip, GHC.List.zip NOTE2: not sure if this gives a meaningful result for a GHC.Name=Return True if a declaration is a type signature declaration.=Return True if a declaration is a type signature declaration.6Return True if a declaration is a function definition. 3Returns True if a declaration is a pattern binding."WReturn True if a declaration is a pattern binding which only defines a variable value.#WReturn True if a declaration is a pattern binding which only defines a variable value.$GReturn True if a declaration is a pattern binding but not a simple one.%BReturn True if a LHsBin is a pattern binding but not a simple one.&>Return True if a declaration is a function/pattern definition.'>Return True if a declaration is a function/pattern definition.(wReturns True is a syntax phrase, say a, is part of another syntax phrase, say b. Expects to be at least Parser output+Find the identifier with the given name. This looks through the given syntax phrase for the first GHC.Name which matches. Because it is Renamed source, the GHC.Name will include its defining location. Returns Nothing if the name is not found.,Add identifiers to the export list of a module. If the second argument is like: Just p, then do the adding only if p occurs in the export list, and the new identifiers are added right after p in the export list. Otherwise the new identifiers are add to the beginning of the export list. In the case that the export list is emport, then if the third argument is True, then create an explict export list to contain only the new identifiers, otherwise do nothing.-Adding a declaration to the declaration list of the given syntax phrase. If the second argument is Nothing, then the declaration will be added to the beginning of the declaration list, but after the data type declarations is there is any./STake a list of strings and return a list with the longest prefix of spaces removed0Zadd items to the hiding list of an import declaration which imports the specified module.=Creates a new entity list for hiding a name in an ImportDecl.8Creates a new entity for hiding a name in an ImportDecl.1Add identifiers (given by the third argument) to the explicit entity list in the declaration importing the specified module name. This function does nothing if the import declaration does not have an explicit entity list.Add identifiers (given by the third argument) to the explicit entity list in the declaration importing the specified module name. If the ImportType argument is Hide, then the items will be added to the "hiding" list. If it is Import, they will be added to the explicit import entries. This function does nothing if the import declaration does not have an explicit entity list and ImportType is Import.5`Duplicate a function/pattern binding declaration under a new name right after the original one.6`Divide a declaration list into three parts (before, parent, after) according to the PNT, where parent( is the first decl containing the PNT, before are those decls before parent and after are those decls after parent.7Remove the declaration (and the type signature is the second parameter is True) that defines the given identifier from the declaration list.Utility function to remove a decl from the middle of a list, assuming the list has already been split into a (possibly empty) front before the decl, and a back where the head is the decl to be removed.9Remove multiple type signatures:^Remove the type signature that defines the given identifier's type from the declaration list.;KRemove the qualifier from the given identifiers in the given syntax phrase.<HReplace all occurences of a top level GHC.Name with a qualified version.=XRename each occurrences of the identifier in the given syntax phrase with the new name.>Check whether the specified identifier is declared in the given syntax phrase t, if so, rename the identifier by creating a new name automatically.@BReturn the identifier's defining location. defineLoc::PNT->SrcLocA=Return the identifier's source location. useLoc::PNT->SrcLocBPReturn True if the identifier is used in the RHS if a function/pattern binding.C4Find all occurrences with location of the given nameE@Return True if the identifier occurs in the given syntax phrase.F@Return True if the identifier occurs in the given syntax phrase.GLReturn True if any of the specified PNames ocuur in the given syntax phrase.HLReturn True if any of the specified PNames ocuur in the given syntax phrase.IReturn the type checked  corresponding to the given KGiven the syntax phrase, find the largest-leftmost expression contained in the region specified by the start and end position, if found.NIf an expression consists of only one identifier then return this identifier in the GHC.Name format, otherwise return the default NameOIf an expression consists of only one identifier then return this identifier in the GHC.Name format, otherwise return the default NameQcIf a pattern consists of only one identifier then return this identifier, otherwise return NothingRcIf a pattern consists of only one identifier then return this identifier, otherwise return NothingSCompose a pattern from a pName.The inscope relation . The resultThe identifier name.The inscope relation The result.The identifier name.4Existing name, to be excluded from test, if known The result.The identifier name. The result.   The old name/The set of names which the new name cannot takeThe posfix value The result The module nameThe AST of the module The result  The identifierThe AST of the module The resultThe original name The new nameThe identity of the moduleThe AST of the module The result !"#$%&'()*+The name to findThe syntax phrase The result, qualifieralias-The AST to be updated_If this is Just, then the declaration will be added right after this identifier's definition.ZThe declaration with optional signatures to be added, together with optional Annotations../0The imported module nameThe current moduleThe items to be added The result1The imported module nameThe current moduleMThe items to be added ->Maybe GHC.Name -- ^ The condition identifier. The resultThe imported module nameThe current moduleMThe items to be added ->Maybe GHC.Name -- ^ The condition identifier.HWhether to hide the names or import them. Uses special data for clarity. The result2=A declaration list where the function is defined and/or used.The function name.The parameters to be added. The result.345;decls to be updated, containing the original decl (and sig)3The identifier whose definition is to be duplicated!The new name (possibly qualified) The result671The identifier whose definition is to be removed.(True means including the type signature.QThe AST fragment containting the declarations, originating from the ParsedSourceJThe result and the removed declaration and the possibly removed siganture898The identifiers whose type signatures are to be removed.The declarations5The result and removed signatures, if there were any:5The identifier whose type signature is to be removed.The declarations3The result and removed signature, if there was one;The identifiers.The syntax phrase. The result.<=The identifier to be renamed.*The new name, including possible qualifier6True means use the qualified form for the new name.The syntax phrase>The identifier.The syntax phrase. The result.?@ABCDEFGHIJKThe start position.The end position.The syntax phrase. The result.LMNOPQRS  \      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS\    !#"%$&'BDEFCGH(IJ*)?@AK+-13024,57:9;<=>LMNOPQRS6  8./y      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRS  None !"#$%&'-;>?@ABCDEHRST]^_`abcdefgklnopqrstuvwxyz{|}~      !"#$%&'()*+,-/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSEabcd]^_`HRST>?@ABCD;gkefl' !"#{n$%&opqrstuwxzy~|}-    !#"%$&'BDEFCGH(IJ*)?@AK+-13024,57:9;<=>LMNOQPRS6  8/vNone*T-Convert an if expression to a case expression Actually do the transformationTU   TUTUTU   None345NVThis refactoring duplicates a definition (function binding or simple pattern binding) at the same level with a new name provided by the user. The new name should not cause name clash/capture.Do refactoring in the client module. That is to hide the identifer in the import declaration if it will cause any problem in the client module.eget the module name or alias name by which the duplicated definition will be imported automatically. VWVWVWVWNone345N X"Lift a definition to the top levelZ3Move a definition one level up from where it is now\ Move a definition one level downGet the subset of pns( that need to be renamed before lifting.Do refactoring in the client module. that is to hide the identifer in the import declaration if it will cause any problem in the client module.@Test whether an identifier defined in the modules specified by names$ will be exported by current module.get the module name or alias name by which the lifted identifier will be imported automatically. TODO: maybe move this into TypeUtils willBeUnQualImportedBy::HsName.ModuleName->HsModuleP->Maybe [HsName.ModuleName]get the subset of pns>, which need to be hided in the import declaration in module i Note: these are newly exported from the module, so we cannot use the GHC name resolution i nthis case.Fail any signature having a forall in it. TODO: this is unnecesarily restrictive, but needs a) proper reversing of GHC.Type to GHC.LhsType b) some serious reverse type inference to ensure that the constraints are modified properly to merge the old signature part and the new.Do refactoring in the client module, that is: a) Check whether the identifier is used in the module body b) If the identifier is not used but is hided by the import declaration, then remove it from the hiding.Demote the declaration of pn in the context of t. .substitute an old expression by new expression!2return True if pn is a local function/pattern nameXY"Z[#\]$The syntax element to update%If specified, add defn after this one!The first one is the decl to moveOThe signatures to remove. May be multiple if decl being moved has a patbind.!lifted decls signature if present0The updated syntax element (and tokens in monad)%&'(name of decl being liftedDeclared names in parentparentdecls being lifted!lifted decls signature if present)*+,-./0'The (list?) function name being demoted1The RHS of the place to receive the demoted decls:Binds of original top level entiity, including src and dstThe decls being demoted Signatures being demoted, if any !XYZ[\]XYZ[\]XY"Z[#\]$%&'()*+,-./0 !None^Rename the given identifier._Body of the refactoring1rActually do the renaming, split into the various things that can be renamed. Returns True if the name is exported^_12345^_^_^_12345None`DRoundtrip the source code, to check that the infrastructure is solid`6```6NoneN ]^_`abcdeTUVWXYZ[\]^_`]^_`abcde TUVWXYZ[\]^_`NoneNa789:;<=aaa789:;<=None Zb-Convert an if expression to a case expression>?b@bb>?b@NoneNcABcccABC !"#$%#$&#$'#$(#$)#$*#$*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX Y Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~           !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                          !"#$%&'()*+,-./0123456789:;<=3>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdZefHaRe_LgSb3nyMpdA7fxKNr7LZPX,Language.Haskell.Refact.Utils.MonadFunctionsLanguage.Haskell.Refact.APILanguage.Haskell.Refact.HaRe Paths_HaRe,Language.Haskell.Refact.Utils.GhcModuleGraph/Language.Haskell.Refact.Utils.GhcBugWorkArounds#Language.Haskell.Refact.Utils.Types%Language.Haskell.Refact.Utils.TypeSyn#Language.Haskell.Refact.Utils.Monad&Language.Haskell.Refact.Utils.LocUtils0Language.Haskell.Refact.Utils.GhcVersionSpecific#Language.Haskell.Refact.Utils.Utils&Language.Haskell.Refact.Utils.GhcUtils(Language.Haskell.Refact.Utils.ExactPrint#Language.Haskell.Refact.Utils.Binds'Language.Haskell.Refact.Utils.Variables'Language.Haskell.Refact.Utils.TypeUtils(Language.Haskell.Refact.Refactoring.Case*Language.Haskell.Refact.Refactoring.DupDef+Language.Haskell.Refact.Refactoring.MoveDef,Language.Haskell.Refact.Refactoring.Renaming-Language.Haskell.Refact.Refactoring.RoundTrip.Language.Haskell.Refact.Refactoring.AddRmParam*Language.Haskell.Refact.Refactoring.Simple,Language.Haskell.Refact.Refactoring.SwapArgsghcex_L0W1WSnXYpvAjYkqbSJYOZ)Language.Haskell.GHC.ExactPrint.TransformliftT%Language.Haskell.GHC.ExactPrint.Utils gfromJustgtailglastgheadshowGhcghcmo_0ULgkwN30A79xrJXYxycOZLanguage.Haskell.GhcMod.TypesdefaultOptionsoptFileMappingsoptGhcUserOptions optPrograms optOutputOptionsversion getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNamegetModulesAsGraphsummaryNodeSummarygetRichTokenStreamWANameMapSimpSpanSimpPos TokenCacheTKtkCache tkLastTreeIdTreeIdTId RefacSourceRSFileRSModRSAlreadyLoaded RefacResult RefacModifiedRefacUnmodifedApplyRefacResultmainTidPNamePNHsNameExportInScopesHsDeclsPHsDeclPHsPatPHsExpP$fOutputableTyFamEqn$fOutputableConDeclField$fOutputableHsTupArg$fOutputableGRHS$fOutputableGRHSs$fOutputableMatch$fOutputableMatchGroup$fOutputableNameSpace$fShowNameSpace RefactGhc unRefactGhc StateStorage StorageNone StorageBind StorageSigStorageBindRdrStorageDeclRdr StorageSigRdr ParseResultTargets CabalGraph TargetModule RefactStateRefSt rsSettings rsUniqState rsSrcSpanColrsFlags rsStoragersCurrentTargetrsModule RefactFlagsRefFlagsrsDone RefactModuleRefModrsTypecheckedMod rsNameMap rsTokenCachersStreamModified RefactStashIdStashRefactSettingsRefSetrsetVerboseLevelrsetEnabledTargets VerboseLevelDebugNormalOffdefaultSettings logSettings runRefactGhccabalModuleGraphscanonicalizeGraphcanonicalizeModSummarygetRefacSettingslogmfetchAnnsFinalgetTypecheckedModulegetRefactStreamModifiedsetRefactStreamModifiedgetRefactInscopesgetRefactRenamedputRefactRenamedgetRefactParsedputRefactParsed setRefactAnnsputParsedModuleclearParsedModulegetRefactTargetModulegetRefactFileNamefileNameFromModSummarygetRefactModulegetRefactModuleNamegetRefactNameMap getRefactDone setRefactDoneclearRefactDonesetStateStoragegetStateStoragelogDataWithAnnslogAnnslogParsedSourceinitRefactModuleinitTokenCacheLayoutinitRdrNameMapmkNewGhcNamePurenameSybTransform nameSybQueryparseDeclWithAnns unmodifiedmodified nullSrcSpanprettyprintPatList getGhcLoc getGhcLocEndgetLocatedStart getLocatedEndghcSpanStartEndgetStartEndLocstartEndLocGhc emptyList nonEmptyList getSrcSpan prettyprint prettyprint2ppType setGhcContext showGhcQual getModuleName getTargetGhcparseSourceFileGhcrunRefacSession applyRefac refactDone modifiedFileswriteRefactoredFilesclientModsAndFilesserverModsAndFileseverywhereMStaged' everywhereM'everywhereStagedeverywhereStaged'onelayerStaged listifyStagedzeverywhereStaged zopenStagedzsomewhereStagedtransZtransZMupUntil findAbove zopenStaged'ztransformStagedM replaceAnnKeycopyAnnreplace HsValBinds hsValBinds hsTyDeclsgetValBindSigshsBinds DeclaredNamesDNdn FreeNamesFNfn FindEntity findEntitysameOccurrence isFieldName isClassNameisInstanceNamehsPNs isDeclaredInisDeclaredInRdrhsFreeAndDeclaredRdrhsFreeAndDeclaredPNsOldhsFreeAndDeclaredNameStringshsFreeAndDeclaredPNshsFreeAndDeclaredGhcgetDeclaredTypesRdrgetDeclaredTypes definedPNs definedPNsRdrdefinedNamesRdrdefiningDeclsRdrNamesdefiningDeclsRdrNames'definingDeclsNamesdefiningDeclsNames'definingSigsNamesdefiningSigsRdrNamesdefiningTyClDeclsNamesdefines definesRdrdefinesDeclRdrdefinesPdefinesTypeSigdefinesTypeSigRdrdefinesSigDRdrallNameshsNamess hsNamessRdrgetDeclaredVarsgetFvs getFreeVars hsVisiblePNshsVisibleNameshsVisibleNamesRdrhsVisiblePNsRdrhsVisibleDsRdr hsVisibleDshsFDsFromInsideRdrhsFDsFromInsidehsFDNamesFromInsidehsFDNamesFromInsideRdr rdrName2Name' rdrName2NamerdrName2NamePure eqRdrNamePure locToName locToRdrName UsedByRhs usedByRhs usedByRhsRdr inScopeInfoisInScopeAndUnqualifiedisInScopeAndUnqualifiedGhc inScopeNamesequivalentNameInNewMod mkRdrName mkNewGhcNamemkNewToplevelName mkNewName modIsExported isExportedisExplicitlyExportedcauseNameClashInExportsgetParsedForRenamedLPatgetParsedForRenamedLocatedgetParsedForRenamedNameusedWithoutQualR getModuleisVarIdisConId isOperator isTopLevelPN isLocalPNisNonLibraryNameisFunOrPatName isQualifiedPN isTypeSig isTypeSigDecl isFunBindP isFunBindR isPatBindP isPatBindRisSimplePatDeclisSimplePatBindisComplexPatDeclisComplexPatBindisFunOrPatBindPisFunOrPatBindR findEntity' sameBindRdrsameBindgetName addImportDecladdDeclrdrNameFromNamestripLeadingSpaces addHidingaddItemsToImportaddParamsToDeclsaddItemsToExportaddActualParamsToRhs duplicateDecl divideDeclsrmDecldeclsSybTransform rmTypeSigs rmTypeSig rmQualifierqualifyToplevelNamerenamePNautoRenameLocalVar isMainModule defineLocuseLoc isUsedInRhsfindAllNameOccurences findNameInRdrfindPNTfindPNfindPNs findNamesRdr findIdForNamegetTypeForNamelocToExpghcToPNlghcToPN expToName expToNameRdr nameToString patToNameRdrpatToPNTpNtoPatifToCase compIfToCase duplicateDefcompDuplicateDefliftToTopLevelcompLiftToTopLevel liftOneLevelcompLiftOneLeveldemote compDemoterename compRename roundTripaddOneParameter removeBracketswapArgscatchIObindirlibdirdatadir libexecdir sysconfdirNodeMapNodeKey SummaryNodesummaryNodeKeymoduleGraphNodes mapCatMaybes home_impsms_home_srcimps ms_home_imps combineTokensstripPreprocessorDirectivesgetPreprocessedSrcgetOriginalFilegetPreprocessorAsCommentsmergeBytokeniseOriginalSrc sbufToString getSuffix parseErrorgetModuleSourceAndFlags getTempDir $fShowModule$fShowModSummary$fExceptionMonadStateT$fHasDynFlagsRefactGhc$fGhcMonadRefactGhc $fMonadStateRefactStateRefactGhc$fMonadIOStateT $fGmOutStateT$fShowStateStorage$fOutputableModulePath$fShowTypecheckedModule $fShowName getRefactAnnsmodifyRefactAnns modifyAnnsrefactRunTransformId putUnique$fHasTransformRefactGhcbase Data.FoldablenullreplaceTabBySpacestweakModSummaryDynFlagsghcDynFlagsOpt_KeepRawTokenStreamHscTypes ModSummaryloadFromModSummarysetTargetSession setDynFlagscdAndDocanonicalizeTargetsmycompmoveAnnsbindsFromDecls emptyValBinds unionBinds$fHsValBindsHsIPBindsname$fHsValBindsGenLocatedname$fHsValBinds[]name$fHsValBindsGenLocatedname0$fHsValBinds[]name0$fHsValBindsGenLocatedname1$fHsValBinds[]name1$fHsValBindsHsWithBndrsname$fHsValBindsHsDataDefnname$fHsValBindsGenLocatedname2$fHsValBinds[]name2$fHsValBinds[]name3$fHsValBinds[]name4$fHsValBindsGenLocatedname3$fHsValBinds[]name5$fHsValBinds[]name6$fHsValBinds[]name7$fHsValBindsTyClGroupname$fHsValBinds[]name8$fHsValBindsNameName$fHsValBindsGenLocatedname4$fHsValBinds[]name9$fHsValBindsGenLocatedname5$fHsValBinds[]name10$fHsValBindsGenLocatedname6$fHsValBinds[]name11$fHsValBindsGenLocatedname7$fHsValBinds[]name12$fHsValBindsGenLocatedname8$fHsValBindsBagname$fHsValBindsStmtLRname$fHsValBindsHsExprname$fHsValBindsHsBindLRname$fHsValBindsMatchname$fHsValBindsGenLocatedname9$fHsValBinds[]name13$fHsValBindsMatchGroupname$fHsValBindsGRHSsname$fHsValBindsHsLocalBindsLRname$fHsValBindsHsGroupname$fHsValBindsHsValBindsLRname$fHsValBinds(,,,)Name$fHsValBindsGenLocatedRdrNameGHC.BaseNothing locToName'emptyFDhsFreeAndDeclaredRdr'hsFreeAndDeclaredPNs'getDeclaredVarsRdr$fMonoidDeclaredNames$fMonoidFreeNames$fShowDeclaredNames$fShowFreeNames$fFindEntityGenLocated$fFindEntityGenLocated0$fFindEntityGenLocated1$fFindEntityGenLocated2$fFindEntityGenLocated3$fFindEntityGenLocated4$fFindEntityName ImportTypeHideImportName nameUniqueRdrNameisId mkNewEntListmkNewEntaddItemsToImport'doRmDeclVarId HowToQualQualify NoQualifyPreserveQualify defaultName$fUsedByRhsStmtLR$fUsedByRhsStmtLR0$fUsedByRhsHsExpr$fUsedByRhsHsExpr0$fUsedByRhsHsBindLR$fUsedByRhsHsBindLR0 $fUsedByRhs[]$fUsedByRhsMatch$fUsedByRhsMatch0$fUsedByRhsHsValBindsLR$fUsedByRhsBag$fUsedByRhsSig$fUsedByRhsDocDecl$fUsedByRhsRuleDecls$fUsedByRhsVectDecl$fUsedByRhsSpliceDecl$fUsedByRhsDefaultDecl$fUsedByRhsHsQuasiQuote$fUsedByRhsRoleAnnotDecl$fUsedByRhsAnnDecl$fUsedByRhsWarnDecls$fUsedByRhsForeignDecl$fUsedByRhsDerivDecl$fUsedByRhsInstDecl$fUsedByRhsTyClDecl$fUsedByRhsHsDecl$fUsedByRhs[]0$fUsedByRhsGenLocated$fUsedByRhsHsModule$fUsedByRhs(,,,)ifToCaseTransformdoIfToCaseInternalreallyDoIfToCaserefactorInClientModwillBeUnQualImportedBy DupDefResult DupDefFailedDupDefTopLevelDupDefLowerLevel doDuplicatingreallyDoDuplicatingdoDuplicatingClientpnsNeedRenamingliftingInClientModwillBeExportedByClientModnamesNeedToBeHidedGHC.RealmodisNewSignatureOkdemotingInClientMod doDemoting'replaceExpWithUpdToksisLocalFunOrPatNameliftToTopLevel' liftOneLevel' moveDecl1askRenamingMsgaddParamsToParentliftedToTopLeveladdParamsToParentAndLiftedDecladdParamsToSigsprintSigComponent typeToLHsTypetyConAppToHsTypedemote'doDemotingInClientMod doDemoting foldParams doRenamingrenameTopLevelVarNamerenameInClientModcauseAmbiguityInExportsisValidNewNamecompcompAdd doAddingParam paramNameOkaddDefaultActualArgDeclmkLocalDefaultArgNameaddDefaultActualArg addArgToSigHsExprHsParremoveBracketTransformdoSwap