!Jk      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                  ! " # $ % & ' ()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Safe  None9;)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 !"#$%&'()*+ !"#$%&'()*)&'( !"#$%*  !"#$%&'()*+None9;3oThe PN is the name as it occurs to the parser, and corresponds with the GHC.RdrName type PN = GHC.RdrName5YHsName is a name as it is found in the source This seems to be quite a close correlationBThe 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 already3456789:;<=>?@AB 3456789:;;:9876534BA@?>=<3456789:;<=>?@ABNoneDEFGHIJKDEFGHIJKKJIHGFEDDEFGHIJKNone !",/29:;<=IT OEProvide some temporary storage while the refactoring is taking placeV]Result of parsing a Haskell source file. It is simply the TypeCheckedModule produced by GHC._State for refactoring a single file. Holds/hides the ghc-exactprint annotations, which get updated transparently at key points.aSession level settingsb@Current Unique creator value, incremented every time it is usedcACurrent SrcSpan creator value, incremented every time it is usedd)Flags for controlling generic traversalse:Temporary storage of values while refactoring takes placeg#The current module being refactoredj+Current traversal has already made a changenrMapping from the names in the ParsedSource to the renamed versions. Note: No strict mark, can be computed lazily.oIToken stream for the current module, maybe modified, in SrcSpan tree formp"current module has updated the ASTDLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~7LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~7Vwxyzstuv_`abcdefgklmnopZ[\]^YWXqrhijOPQRSTULMN}{|~"LMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None /9:;<=OTfetch the final annotations For testingYInternal low level interface to access the current annotations from the RefactGhc state.OMerges new annotations with the currecnt 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.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.,'', None9;'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 None9:;T$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 instanceCollect those type variables that are declared in a given syntax phrase t. In the returned result, the first list is always be empty. The same as > except that the returned variables are in the String format.Return the free and declared Names in the given syntax fragment. The syntax fragment MUST be parameterised by RdrName, else the empty list will be returned.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 ParsedSourceGet the names of all types declared in the given declaration getDeclaredTypesRdr :: GHC.LTyClDecl GHC.RdrName -> RefactGhc [GHC.Name]DReturn True if the specified Name ocuurs in the given syntax phrase.LReturn True if any of the specified PNames ocuur in the given syntax phrase.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.=Find those declarations which define the specified GHC.Names.NReturn True if the function/pattern binding defines the specified identifier.fUnwraps a LHsDecl and calls definesRdr on the result if a HsBind or calls clsDeclDefinesRdr if a TyClDKReturn True of the type class declaration defines the specified identifier;Returns True if the provided Name is defined in the LHsDeclWReturn True if the declaration defines the type signature of the specified identifier.=Unwraps a LHsDecl and calls definesRdr on the result if a Sig-Get all the names in the given syntax elementDoes the given  appear as a   anywhere in t?Same as hsVisiblePNsRdr< except that the returned identifiers are in String format.Given a Name n and a syntax phrase t, if n occurs in t, then return those variables which are declared in t and accessible to n, 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 ParsedSource The same as hsFDsFromInside= except that the returned variables are in the String format The same as hsFDsFromInside= except that the returned variables are in the String formatReturns True if both GHC.Names are in the same  GHC.NameSpace. Find 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.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 AST=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 row and column number+The syntax phrase, parameterised by RdrName The result The row and column number+The syntax phrase, parameterised by RdrName The result The row and column numberThe syntax phrase The resultThe row and column numberThe syntax phrase The result  .   .   8      NoneOT Monadic variation on everywhere' Monadic variation on everywhere'Bottom-up transformation$Top-down version of everywhereStagedStaged 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 structures 4Transform 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 holds#GUp the zipper until a predicate holds, and then return the zipper hole$Open 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 zipper%Open a zipper to the point where the Generic query passes, and apply the transformation returned from the specific part of the GenericQ that matched. !"#$% !"#$% !$%"# !"#$% NoneM &'&'&' &'None !"/9:;<=OT(?Extract the module name from the parsed source, if there is one*-Parse a single source file into a GHC sessionGiven a  ModSummary+, parses and typechecks it, returning the TcGblEnv< resulting from type-checking. Based on GHC.hscFileFrontendThis gets called on every module compiled when loading the wanted target. When it is the wanted target, keep the ParsedSource and TypecheckedSource, with API Annotations enabled.For 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 monad+Manage 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 called,Like runRefacSession but instead takes an ordered list of RefactGhc computations and runs all of them threading the state through all of the computationsfTake an ordered list of refactorings and apply them in order, threading the state through all of them-AApply a refactoring (or part of a refactoring) to a single module/<Returns True if any of the results has its modified flag set1)Write refactored program source to files.2Return the client modules and file names. The client modules of module, say m, are those modules which directly or indirectly import module m.3 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?4iIn GHC 8 an error has an attached callstack. This is not always what we want, so this function strips it()*+ghc-mod options>The computation doing the refactoring. Normally created via -,-.6Boolean that determines if the state should be clearedThe refactoring where to get the module and toks/01234()*+,-./01234)*+-./(23,014()*+,-./01234None5Replacement for original getRichTokenStreamE which will return the tokens for a file processed by CPP. See bug +http://ghc.haskell.org/trac/ghc/ticket/8265Combine 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 modeNStrip out the CPP directives so that the balance of the source can tokenised.%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.?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 failsCGet the preprocessor directives as comment tokens from the source.uMerge 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 555 5None#9:;OT6The annotations are keyed to the constructor, so if we replace a qualified with an unqualified RdrName or vice versa we have to rebuild the key for the appropriate annotation.80Replaces an old expression with a new expression8Shift the first output annotation into the correct place9 Change the DeltaPos for a given  KeywordId5 if it appears in the annotation for the given item.:1Remove any preceding comments from the given item6789:;<=>?@ABCDEF6789:;<=>?@ABCDEF8679:;<=>?A@BDCEF6789:;<=>?@ABCDEFNone9:;OTCDRepresents the operation type we want to select on addItemsToImport'Used for addHidingUsed for addItemsToImportLHReturn True if any of the GHC.Name's appear in the given syntax elementMProcess 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.NNReturn True if the identifier is inscope and can be used without a qualifier.OReturn 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.P Return all >s that correspond to the given string, in the current module.QGiven 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.RReturn all the possible qualifiers for the identifier. The identifier is not inscope if the result is an empty list. NOTE: This is intended to be used when processing a client module, so the 0 parameter is actually from a different module.SMake a qualified TMake a simple unqualified U Register a   in the A so it can be looked up if needed. This will create a brand new N, so no guarantees are given as to matches later. Perhaps this is a bad idea.VNMake a new GHC.Name, using the Unique Int sequence stored in the RefactState.X@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.YpReturn True if the current module is exported either by default or by specifying the module name in the export.ZSReturn 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 export]Return True if the identifier is unqualifiedly used in the given syntax phrase. Check in a way that the test can be done in a client module, i.e. not using the nameUnique 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.a;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.*b+Return True if a PName is a toplevel PName.c(Return True if a PName is a local PName.dReturn True if the name has a  GHC.SrcSpan+, i.e. is declared in source we care aboute?Return True if a PName is a function/pattern name defined in t.fReturn 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.Nameg=Return True if a declaration is a type signature declaration.h=Return True if a declaration is a type signature declaration.i6Return True if a declaration is a function definition.k3Returns True if a declaration is a pattern binding.mWReturn True if a declaration is a pattern binding which only defines a variable value.nWReturn True if a declaration is a pattern binding which only defines a variable value.oGReturn True if a declaration is a pattern binding but not a simple one.pBReturn True if a LHsBin is a pattern binding but not a simple one.q>Return True if a declaration is a function/pattern definition.r>Return True if a declaration is a function/pattern definition.swReturns True is a syntax phrase, say a, is part of another syntax phrase, say b. Expects to be at least Parser outputuFind 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.vAdd 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.wAdding 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.yZadd 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.zAdd 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. 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.}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 empty, then if the third argument is True, then create an explict export list to contain only the new identifiers, otherwise do nothing. TODO:AZ: re-arrange params to line up with addItemsToExport`Duplicate a function/pattern binding declaration under a new name right after the original one.`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.Remove 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.Remove 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->SrcLoc=Return the identifier's source location. useLoc::PNT->SrcLocReturn the type checked  corresponding to the given Given the syntax phrase, find the largest-leftmost expression contained in the region specified by the start and end position, if found.If an expression consists of only one identifier then return this identifier in the GHC.Name format, otherwise return the default NamecIf a pattern consists of only one identifier then return this identifier, otherwise return NothingCompose a pattern from a pName.qGHIJKLMThe inscope relation . The resultNThe identifier name.The inscope relation The result.OThe identifier name.4Existing name, to be excluded from test, if known The result.PThe identifier name. The result.QRThe identifier. The result.STUVWX The old name/The set of names which the new name cannot takeThe posfix value The resultYThe module nameThe AST of the module The resultZ[The identifierThe AST of the module The result\The original name The new nameThe identity of the moduleThe AST of the module The result]^_`a bcdefghijklmnopqrstuThe name to findThe syntax phrase The resultv qualifieraliaswThe 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.xyThe imported module nameThe current moduleThe items to be added The result  zThe imported module nameThe condition identifier.The items to be addedThe current module The result The imported module nameFThe current module -> [GHC.RdrName] -- ^ The items to be addedMThe items to be added ->Maybe GHC.Name -- ^ The condition identifier.HWhether to hide the names or import them. Uses special data for clarity. The result{ |=A declaration list where the function is defined and/or used.The function name.The parameters to be added. The result.}The module AST.The condtion identifier.Create an explicit list or not?The identifiers to add in either String or HsExportEntP format. The result.~;decls to be updated, containing the original decl (and sig)3The identifier whose definition is to be duplicated!The new name (possibly qualified) The result1The 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 siganture8The identifiers whose type signatures are to be removed.The declarations5The result and removed signatures, if there were any5The identifier whose type signature is to be removed.The declarations3The result and removed signature, if there was oneThe identifiers.The syntax phrase. The result.The identifier to be renamed.*The new name, including possible qualifierThe syntax phraseThe identifier.The syntax phrase. The result.The start position.The end position.The syntax phrase. The result.N GJHIKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~NMNOPZ[YQR_`abcdfeghijklnmpoqrstKL^ uwz}y|{~vGHIJ]TSVXWU\xkGHIJKLMNOPQRSTUVWXYZ[\]^_`a bcdefghijklmnopqrstuvwxy  z { |}~NoneTNone<<None&'()7DEFGHIJKLOPQRSTUVYZ[\]^hijstuvwxyz{|}    !"#$%()*+,-./234789:;<=>?@ABCDEFGJHIKLMNOPQRSTUVWXYZ[\]^_`abcdefgijklmnopqrstuvwyz{|}~VwxyzstuvYhijOPQRSTUL}{|*)+,-./)Z[\]^(234&'(7MNOPZ[YQR_`abcdfegijklnmpoqr]stKL^   uwz}y|{~vGHIJTSVXWU\ !$%"#897:;A@BDCEF=>?KJIHGEFD<NoneT +check whether the new parameter is a legal.Ladd the default argument declaration right after the declaration defining pn]suppose function name is f, parameter name is p, then the default argument name is like f_p.[Add the default argument to each call site of the function receiving the new parameter (AZ)Add a parameter to a  expressionAdd type arg to type siginature<Add default actual argument to pn in all the calling places. The refactoring removes a user specified formal parameter in a function binding,and the corresponding actual parameters in all calling places of this function. The condition acompanying this refactoring is that the parameter to be removed is not being used. The SimpPos8 should be somwewhere inside the parameter to be removedlRemove the nth argument of function pn in all the calling places. The index for the first argument is zero.]Get the function name and the index of the parameter to be removed from the cursor position.If True recursively add the parameter to all occurences of the function call site. If False, stop the recursion when hitting the function itself..The function name to receive the new parameter2The new parameter name ++AZ++: why is it located?The AST fragment to be updated !"#$% !"#$%None/-Convert an if expression to a case expression&Actually do the transformation'(&'(&NoneT)*+,-)*+,-None9:;TThis 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. 012345.6/012345.6/None0789:;<=>?@ABCDEFGHIJKL789:;<=>?@ABCDEFGHIJKLNone9:;T "Lift a definition to the top level3Move a definition one level up from where it is now Move a definition one level downMGet the subset of pns( that need to be renamed before lifting.NDo 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.O@Test whether an identifier defined in the modules specified by names$ will be exported by current module.Pget 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]Qget the subset of pns>, which need to be hided in the import declaration in module Ri Note: these are newly exported from the module, so we cannot use the GHC name resolution in this case.SdWhen liftOneLevel is complete, identify whether any new declarations have been put at the top levelTDo 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.UDemote the declaration of pn in the context of t.V.substitute an old expression by new expressionW2return True if pn is a local function/pattern nameXYZ[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)\M]NOPQS^name of decl being liftedDeclared names in parentparentdecls being lifted!lifted decls signature if present_T`aUb'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 anyVWXYZ[\M]NOPQS^_T`aUbVWNoneTRename the given identifier.Body of the refactoringcrActually do the renaming, split into the various things that can be renamed. Returns True if the name is exporteddZSome non-trivial condition checking. Returns on success, throws an error on check failure ecdfghijkl ecdfghijklNoneDRoundtrip the source code, to check that the infrastructure is solidmmNoneT( stuvwxyz{(stuvwxyz{ None$b-Convert an if expression to a case expressionnopnopNoneTqrqrs !"!#!$!%!&'()'(*'(+'(,'(-'(.'(/'(0'(0123456789:;<=>?@AABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmmnopqrstuvwxyz{|}~L                                    ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E FGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~              !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwWxyz{|}~@#HaRe-0.8.4.1-EARcnRaNmn7KUboVM3DOvg,Language.Haskell.Refact.Utils.MonadFunctionsLanguage.Haskell.Refact.APILanguage.Haskell.Refact.HaRe Paths_HaRe#Language.Haskell.Refact.Utils.Types%Language.Haskell.Refact.Utils.TypeSyn&Language.Haskell.Refact.Utils.Synonyms#Language.Haskell.Refact.Utils.Monad&Language.Haskell.Refact.Utils.LocUtils0Language.Haskell.Refact.Utils.GhcVersionSpecific'Language.Haskell.Refact.Utils.Variables&Language.Haskell.Refact.Utils.GhcUtils,Language.Haskell.Refact.Utils.GhcModuleGraph#Language.Haskell.Refact.Utils.Utils/Language.Haskell.Refact.Utils.GhcBugWorkArounds(Language.Haskell.Refact.Utils.ExactPrint'Language.Haskell.Refact.Utils.TypeUtils#Language.Haskell.Refact.Utils.Query'Language.Haskell.Refact.Utils.Transform.Language.Haskell.Refact.Refactoring.AddRmParam(Language.Haskell.Refact.Refactoring.Case-Language.Haskell.Refact.Refactoring.DeleteDef*Language.Haskell.Refact.Refactoring.DupDef2Language.Haskell.Refact.Refactoring.GenApplicative+Language.Haskell.Refact.Refactoring.MoveDef,Language.Haskell.Refact.Refactoring.Renaming-Language.Haskell.Refact.Refactoring.RoundTrip*Language.Haskell.Refact.Refactoring.Simple,Language.Haskell.Refact.Refactoring.SwapArgs-ghc-exactprint-0.5.4.0-3pW4iFJzjemFVHm6KdkUTI)Language.Haskell.GHC.ExactPrint.TransformliftT%Language.Haskell.GHC.ExactPrint.Utils gfromJustgtailglastgheadshowGhc&ghc-mod-5.8.0.0-G2Y0xCFc7g81ZIWCO5ukJq GhcMod.TypesdefaultOptionsoptStackBuildDeps optEncodingoptFileMappingsoptGhcUserOptions optPrograms optOutputOptionsversion getBinDir getLibDir getDataDir getLibexecDir getSysconfDirgetDataFileNameNameMapSimpSpanSimpPos TokenCacheTKtkCache tkLastTreeIdTreeIdTIdTypecheckedModuletmParsedModuletmRenamedSourcetmTypecheckedSource tmMinfExports tmMinfRdrEnv RefacResult RefacModifiedRefacUnmodifedApplyRefacResultmainTid$fShowTypecheckedModule$fShowRefacResult$fOrdRefacResult$fEqRefacResult $fEqTreeId $fOrdTreeId $fShowTreeId$fShowTokenCachePNamePNHsNameExportInScopesHsDeclsPHsDeclPHsPatPHsExpP$fOutputableHsTupArg$fOutputableGRHS$fOutputableGRHSs$fOutputableMatch$fOutputableMatchGroup$fOutputableNameSpace$fShowNameSpace $fEqPName ParsedBind ParsedLStmt ParsedLExpr ParsedExpr ParsedLMatchParsedMatchGroup ParsedGRHSsUnlocParsedHsBind RefactGhc unRefactGhc StateStorage StorageNone StorageBind StorageSigStorageBindRdrStorageDeclRdr StorageSigRdr ParseResultTargets CabalGraph TargetModule RefacSourceRSFileRSTargetRSModRSAlreadyLoaded RefactStateRefSt rsSettings rsUniqState rsSrcSpanColrsFlags rsStoragersCurrentTargetrsModule RefactFlagsRefFlagsrsDone RefactModuleRefModrsTypecheckedMod rsNameMap rsTokenCachersStreamModified RefactStashIdStashRefactSettingsRefSetrsetVerboseLevelrsetEnabledTargets VerboseLevelDebugNormalOffdefaultSettings logSettings runRefactGhccabalModuleGraphscanonicalizeGraphcanonicalizeModSummarygetRefacSettingslogm $fShowModule$fShowModSummary$fExceptionMonadStateT$fHasDynFlagsRefactGhc$fGhcMonadRefactGhc $fMonadStateRefactStateRefactGhc$fMonadIOStateT $fGmOutIO $fGmOutStateT$fShowStateStorage$fOutputableModulePath $fShowName$fEqVerboseLevel$fShowVerboseLevel$fShowRefactSettings$fShowRefactStashId$fEqRefactStashId$fOrdRefactStashId$fShowRefactModule$fShowRefactFlags$fShowRefactState$fFunctorRefactGhc$fApplicativeRefactGhc$fAlternativeRefactGhc$fMonadRefactGhc$fMonadPlusRefactGhc$fMonadIORefactGhc$fGmEnvRefactGhc$fGmOutRefactGhc$fMonadIORefactGhc0$fExceptionMonadRefactGhc$fShowGenLocatedfetchAnnsFinalgetTypecheckedModulegetRefactStreamModifiedsetRefactStreamModifiedgetRefactInscopesgetRefactRenamedputRefactRenamedgetRefactParsedputRefactParsedmergeRefactAnns setRefactAnnsputParsedModuleclearParsedModulegetRefactTargetModulegetRefactFileNamefileNameFromModSummarygetRefactModulegetRefactModuleNamegetRefactNameMap addToNameMap getRefactDone setRefactDoneclearRefactDonesetStateStoragegetStateStoragelogDataWithAnns logExactprintlogAnnslogParsedSourceexactPrintParsedexactPrintExprinitRefactModuleinitTokenCacheLayoutinitRdrNameMapmkNewGhcNamePurenameSybTransform nameSybQueryparseDeclWithAnns$fHasTransformRefactGhc unmodifiedmodified nullSrcSpanprettyprintPatList getGhcLoc getGhcLocEndgetLocatedStart getLocatedEndghcSpanStartEndgetStartEndLocstartEndLocGhc emptyList nonEmptyList getSrcSpan prettyprint prettyprint2ppType setGhcContext showGhcQual DeclaredNamesDNdn FreeNamesFNfn FindEntity findEntitysameOccurrence isFieldName isClassNameisInstanceName hsTypeVblsisDeclaredInRdrhsFreeAndDeclaredNameStringshsFreeAndDeclaredPNshsFreeAndDeclaredRdrgetDeclaredTypesRdr findNameInRdr findNamesRdr definedPNsRdrdefinedNamesRdrdefiningDeclsRdrNamesdefiningDeclsRdrNames'definingSigsRdrNamesdefiningTyClDeclsNames definesRdrdefinesDeclRdrdefinesNameRdrdefinesTypeSigRdrdefinesSigDRdr hsNamessRdr findLRdrNamegetDeclaredVarsRdrhsVisibleNamesRdrhsVisibleDsRdrhsFDsFromInsideRdrhsFDNamesFromInsideRdrhsFDNamesFromInsideRdrPure rdrName2NamerdrName2NamePure eqRdrNamePure sameNameSpace locToNameRdrlocToNameRdrPure locToRdrName$fMonoidDeclaredNames$fMonoidFreeNames$fShowDeclaredNames$fShowFreeNames$fFindEntityGenLocated$fFindEntityGenLocated0$fFindEntityGenLocated1$fFindEntityGenLocated2$fFindEntityGenLocated3$fFindEntityGenLocated4$fFindEntityNameeverywhereMStaged' everywhereM'everywhereButMeverywhereStagedeverywhereStaged' listifyStagedzeverywhereStaged zopenStagedzsomewhereStagedtransZtransZMupUntil findAbove zopenStaged'ztransformStagedMgetModulesAsGraphsummaryNodeSummary getModuleName getTargetGhcparseSourceFileGhcrunRefacSessionrunMultRefacSession applyRefac applyRefac' refactDone modifiedFileswriteRefactoredFilesclientModsAndFilesserverModsAndFilesstripCallStackgetRichTokenStreamWA replaceAnnKeycopyAnnreplacesetAnnKeywordDPclearPriorCommentsbalanceAllCommentslocate addEmptyAnn addAnnValaddAnnsetDPzeroDPhandleParseResultsynthesizeAnns removeAnns addNewKeywordaddNewKeywords HowToQualQualify NoQualifyPreserveQualify UsedByRhs usedByRhsRdr inScopeInfoisInScopeAndUnqualifiedisInScopeAndUnqualifiedGhc inScopeNamesequivalentNameInNewMod hsQualifiermkQualifiedRdrName mkRdrNameregisterRdrName mkNewGhcNamemkNewToplevelName mkNewName modIsExported isExportedisExplicitlyExportedcauseNameClashInExportsusedWithoutQualR getModuleisVarIdisConId isOperator isTopLevelPN isLocalPNisNonLibraryNameisFunOrPatName isQualifiedPN isTypeSig isTypeSigDecl isFunBindP isFunBindR isPatBindP isPatBindRisSimplePatDeclisSimplePatBindisComplexPatDeclisComplexPatBindisFunOrPatBindPisFunOrPatBindR findEntity' sameBindRdrgetName addImportDecladdDeclrdrNameFromName addHidingaddItemsToImportaddParamsToSigsaddParamsToDeclsaddItemsToExportaddActualParamsToRhs duplicateDecl divideDeclsrmDecldeclsSybTransform rmTypeSigs rmTypeSig rmQualifierqualifyToplevelNamerenamePNautoRenameLocalVar isMainModule defineLocuseLoc findIdForNamegetTypeForNamelocToExp expToNameRdr nameToString patToNameRdrpNtoPat$fOutputableHowToQual$fUsedByRhsStmtLR$fUsedByRhsHsExpr$fUsedByRhsHsBindLR$fUsedByRhsMatch$fUsedByRhsSig$fUsedByRhsDocDecl$fUsedByRhsRuleDecls$fUsedByRhsVectDecl$fUsedByRhsSpliceDecl$fUsedByRhsDefaultDecl$fUsedByRhsRoleAnnotDecl$fUsedByRhsAnnDecl$fUsedByRhsWarnDecls$fUsedByRhsForeignDecl$fUsedByRhsDerivDecl$fUsedByRhsInstDecl$fUsedByRhsTyClDecl$fUsedByRhsHsDecl $fUsedByRhs[] $fUsedByRhsIE$fUsedByRhs[]0$fUsedByRhsMaybe$fUsedByRhsGenLocated$fUsedByRhsHsModule$fShowHowToQual $fEqHowToQual getVarAndRHS getHsBindisHsVaraddSimpleImportDecl wrapInLambdawrapInParsWithDPs wrapInPars removePars addNewLinesaddOneParametercompAddOneParameterrmOneParametercompRmOneParameterifToCase compIfToCase deleteDef compDeleteDef duplicateDefcompDuplicateDef$fEqDupDefResult$fShowDupDefResultgenApplicativecompGenApplicativeliftToTopLevelcompLiftToTopLevel liftOneLevelcompLiftOneLeveldemote compDemoterename compRename roundTrip removeBracketswapArgscatchIObindirlibdirdatadir libexecdir sysconfdir getRefactAnnsmodifyRefactAnns modifyAnnsrefactRunTransformId putUniquebase Data.FoldablenullreplaceTabBySpacesclsDeclDefinesRdrghcNameSrcLocLocatedRdrNameGHC.BaseNothing locToName'emptyFDhsFreeAndDeclaredRdr'NodeMapNodeKey SummaryNodesummaryNodeKeymoduleGraphNodes mapCatMaybesms_home_srcimps ms_home_imps hscFrontendtweakModSummaryDynFlagsDynFlagsOpt_KeepRawTokenStreamHscTypes ModSummaryloadFromModSummary threadState installHooksrunHscFrontendmergeRefResultscdAndDomycomp combineTokensstripPreprocessorDirectivesgetPreprocessedSrcgetOriginalFilegetPreprocessorAsCommentsmergeBytokeniseOriginalSrc sbufToString getSuffix parseErrorgetModuleSourceAndFlags getTempDirmoveAnns ImportTypeHideImport nameUniqueisId mkNewEntListmkNewEntaddItemsToImport'isNewSignatureOkdoRmDeclVarIdmodInfoTopLevelScope typeToLHsTypetyConAppToHsTypemkMatch paramNameOkaddDefaultActualArgDeclmkLocalDefaultArgNameaddDefaultActualArg addParamToExpHsExprHsVar addArgToSigaddDefaultActualArgInClientModrmNthArgInFunCallgetParam doAddingParammkTopLevelDefaultArgNameaddArgInClientModaddArgInClientMod' doRmParam rmNthArgInSigrmParamInClientModrmNthArgInFunCallModifToCaseTransformdoIfToCaseInternalreallyDoIfToCaseisPNUsed pnUsedInScopeisPNUsedInClientspnUsedInClientScope doDeletionrefactorInClientModwillBeUnQualImportedBy DupDefResult DupDefFailedDupDefTopLevelDupDefLowerLevel doDuplicatingreallyDoDuplicatingdoDuplicatingClientdoGenApplicativecheckPreconditions gContains replaceFunRhsprocessReturnStatementisJustBoundVar getDoStmts findBoundVars getReturnRhsconstructAppChain nameOccurs isBindStmtlFAppfAppisFApplLApplApplRApprApp lInfixFmap infixFmaphsVarpnsNeedRenamingliftingInClientModwillBeExportedByClientModnamesNeedToBeHidedGHC.RealmodliftedToTopLeveldemotingInClientMod doDemoting'replaceExpWithUpdToksisLocalFunOrPatNameliftToTopLevel' isTupleDecl liftOneLevel' moveDecl1askRenamingMsgaddParamsToParentaddParamsToParentAndLiftedDecldemote'doDemotingInClientMod doDemoting foldParams doRenaming condChecking2 condCheckingdeclaredVarsInSameGroup condChecking1renameTopLevelVarNamerenameLocalVarNamerenameInClientModcauseAmbiguityInExportsisValidNewNamecompHsParremoveBracketTransformdoSwap