!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ Safe-InferedGFetch the installed package info from the global and user package.conf 4 databases, mimicking the functionality of ghc-pkg.  Safe-Inferedaa cabal package name of package version !is the package exposed or hidden 3components in the cabal file that use this package fall modules. We keep all modules so that we can try to open non exposed but imported modules directly component in cabal file  test suite test suite name  executable executable name library is the test suite buildable is the executable buildable is the library buildable #Verbosity settings (build flags for a specific file flags for GHC flags for preprocessor module name if known  complete result for outline "outline contents #exports $imports %'definition of an import statement ' module name (location in source file )is the import qualified *3is the import element list for hiding or exposing + alias name ,specific import elements -#definition of an import element /name 0type 1location in source file 2#children (constructor names, etc.) 3definition of export 5name 6type 7location in source file 8#children (constructor names, etc.) 9Type of import/export directive :reexport module ;specific import/ export list <import/export everythin =Abs >Var ? Lexer token Atype of token B location Celement of the outline result Ename F#types: can have several to combine Gspan in source Hchildren (constructors...) Itype signature if any Jcomment if any K/Span inside a file, the file is known and doesn't need to be repeated Mstart location N end location O3Location inside a file, the file is known and doesn't need to be repeated Qline Rcolumn S)type of elements for the outline _#which cabal file to use operations `1use temporary file that was saved in temp folder ause proper file b!result: success + files impacted desimple type encapsulating the fact the operations return along with notes generated on files ea note on a source file gstatus of the note hmessage iwhere the note is jlocation of a note/error l source file mline ncolumn o"status of notes: error or warning rthe state we keep tname of temporary folder upath to the cabal executable vpath of the project cabal file wverbosity of logging xflags to pass cabal y#extra arguments to cabal configure z State type |construct a file span }Econstructs an OutlineDef with no children and no type signature ~Bconstructs an OutlineDef with children and no type signature .get the full path for the temporary directory Wget the full path for the temporary dist directory (where cabal will write its output) @get full path in temporary folder for source file (i.e. where we'<re going to write the temporary contents of an edited file) -get the full, canonicalized path of a source get the full path of a source 7copy a file from the normal folders to the temp folder 0replace relative file path by module name http:book.realworldhaskell.orgread:io-case-study-a-library-for-searching-the-filesystem.html Fdebug method: fromJust with a message to display when we get Nothing ?remove a base directory from a string representing a full path   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{| start line  start column  end line  end column }name #types: can have several to combine span in source ~name #types: can have several to combine span in source children (constructors...) relative path of source file relative path of source file relative path of source file  copy even if temp file is newer relative path of source file =return Just the file if copied, Nothing if no copy was done      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~zrstuvwxyoqpjklmnefghi{dbc_a`S^]\[ZYXWVUTOPQRKLMN|CDEFGHIJ}~?@AB9>=<;:345678-./012%&'()*+, !"#$  G   !"#$%&'()*+,-./0123456789>=<;:?@ABCDEFGHIJKLMNOPQRS ^]\[ZYXWVUT_a`bcdefghijklmnoqprstuvwxyz{|}~    Safe-Infered.the cabal build info for a specific component the build info the component local build info (the folder to build that component into is the component the library Pthe module name and corresponding source file for each contained Haskell module run cabal build run cabal build run cabal configure $get the full path to the cabal file 2get Cabal build info, running configure if needed 'run a action with the cabal build info 7parse cabal error messages and transform them in notre parse messages from build add a message to the note (get the path of a file getting compiled )canonicalize the paths in the build info Aapply a function on the build info modules and paths, in a monad 5apply a function on the build info modules and paths +get the build info for a given source file J if a source file is in several component, get the first one 'get GHC options for a file get CPP options for a file get the cabal extensions +get the source directory from a build info Kget all components, referencing all the files found in the source folders Wget all components, referencing only the files explicitely indicated in the cabal file )convert a ModuleName to a String %get all components in the Cabal file +get all the dependencies in the cabal file ]get all dependencies from the package description and the list of installed packages 8get all components from the package description )>do we want output (True) or just compilation without linking? &use original cabal or temp cabal file can we rerun configure again >do we want output (True) or just compilation without linking? &use original cabal or temp cabal file &use original cabal or temp cabal file 8return the build info on success, or Nothing on failure &use original cabal or temp cabal file &use original cabal or temp cabal file &use original cabal or temp cabal file %action to run if we get a build info @the result of the action, or Nothing if we could get Cabal info  cabal file path to cabal executable  error output path to cabal executable  cabal file path to cabal executable line  cabal file path to cabal executable the dist directory the build output the cabal file  the dist dir original note message lines the message line the path if we could parse it the function to apply the original build info  the result the function to apply the original build info  the result the source file the cabal info ,the module name and the options to pass GHC the cabal info the list of CPP options the cabal info %the module name and cabal extensions the build info &the source paths, guaranteed non null the build info the result is an array of tuples: the path to the package database, the list of packages in that db that the Cabal file references the cabal description 5the installed packages, by package database location 6the referenced packages, by package database location the package description ))# Safe-Infered  simple type for search function  ?get the file storing the information for the given source file remove the storage file store the build flags store the GHC generated AST !read the GHC AST as a JSON value /read the build flags and notes as a JSON value ?utility function to store the given value under the given key 7read the top JSON value containing all the information rconvert a Data into a JSON value, with specific treatment for interesting GHC AST objects, and avoiding the holes Sdebug function: shows on standard output the JSON representation of the given data -debug searching thing at point in given data .find in JSON AST and return the string result find in JSON AST @overlap function: find whatever is at the given line and column "extract the source span from JSON &extract the source location from JSON "resolve the type of an expression JReduce a top-level type application if possible. That is, we perform the  following simplification step:    (forall v . t) t' ==> t [t'/v]    where [t'/v] is the substitution of t' for v.   the source file the source file the source file build flags and notes the source file  the GHC AST the source file the source file ctime the cabal file was changed. If the file was changed after the storage file, we return Nothing the source file +the key under which the value will be put  the value the source file  should the output be qualified? "should the output be fully typed? result of search the evaluation function $the root object containing the AST line column         Safe-Inferedget the GHC typechecked AST 0perform an action on the GHC Typechecked module &perform an action on the GHC JSON AST 5the main method loading the source contents into GHC Convert  to '[BWNote]'. BThis will mix warnings and errors, but you can split them back up  by filtering the '[BWNote]' based on the  bw_status. get all names in scope get the thing at a particular point (line/column) in the source 0 this is using the saved JSON info if available @convert a GHC SrcSpan to a Span, ignoring the actual file info )convert a GHC SrcSpan to a BWLocation Mconvert a column info from GHC to our system (1 based) =convert a column info from our system (1 based) to GHC LGet a stream of tokens generated by the GHC lexer from the current document _Filter tokens whose span appears legitimate (start line is less than end line, start column is  less than end column.) EConvert a GHC token to an interactive token (abbreviated token type) NGenerate the interactive token list used by EclipseFP for syntax highlighting &Extract occurrences based on lexing OParse the current document, generating a TokenDef list, filtered by a function LPreprocess some source, returning the literate and Haskell source as tuple. -convert a GHC error message to our note type /convert a GHC warning message to our note type .remove the initial status text from a message make unqualified token ?make qualified token: join the qualifier and the name by a dot JMake a token definition from its source location and Lexer.hs token type. (mkTokenDef :: Located Token -> TokenDef FmkTokenDef (L sp t) = TokenDef (mkTokenName t) (ghcSpanToLocation sp) %the source file the base directory the module name the GHC options  the action the source file the base directory the module name the GHC options  the action the source file the base directory the module name the GHC options *the final action to perform on the result the source file the base directory the module name the GHC options base directory  GHC messages  source path base directory  module name build options line column A -> Bool ^ do we want the result qualified by the module E -> Bool ^ do we want the full type or just the haddock type source file path base directory  module name  build flags Base directory The file path to the document  The document' s contents  The options <Project root or base directory for absolute path conversion Contents to be parsed Token value to find 9Literate source flag (True = literate, False = ordinary) Options  The project's root directory ,The current document contents, to be parsed Literate Haskell flag  The options 0Transform function from GHC tokens to TokenDefs The TokenDef filter function the source contents is the source literate Haskell ;the preprocessor tokens and the final valid Haskell source  the name the qualifier  the name !$$"!  Safe-Infered" get the AST #$get the ouline from the AST $build the comment map %get the import/export declarations &-convert a HSE span into a buildwrapper span '#all known extensions, as string " input text options #the commented AST $=the map: key is line, value is start column and comment text  the comment % the AST ()*+&' "#$%()*+&' "#$%()*+&' Safe-Infered8copy all files from the project to the temporary folder synchronize one file only !write contents to temporary file run cabal configure run cabal build build one source file in GHC preprocess a file &get the build flags for a source file 3get haskell-src-exts commented AST for source file (get GHC typechecked AST for source file !perform an action on the GHC AST get outline for source file +get all occurrences of a token in the file 'get lexer token types for source file get thing at point 1get all names in scope (GHC API) get cabal dependencies get cabal components [if true copy all files, if false only copy files newer than their corresponding temp files  return the list of files copied balways copy the file, if false only copy the file if it is newer than its corresponding temp file &the source file in the project folder 1return Nothing if no copy or Just file if copied 'the source file in the project folder the contents use the source or temp cabal True if configure succeeded >do we want output (True) or just compilation without linking? &use original cabal or temp cabal file the source file True if build is successful the build flags the file to preprocess the resulting code the source file the source file the source file the source file the source file  source file the source file the source file the token to search for the source file  the line  the column 6 -> Bool -- ^ do we want the result qualified? 2 -> Bool -- ^ do we want the result typed? ,      !"##$%&''()*++,-./012234567789:;<=>?@ABBCDEEFGHIJKLLMNOOPQRSTUVWXYZ[\]^_`aabccdefgghijklmnnopqrstuvwxyz{|}~            ! " # $%buildwrapper-0.5.2"Language.Haskell.BuildWrapper.Base#Language.Haskell.BuildWrapper.Cabal!Language.Haskell.BuildWrapper.GHC!Language.Haskell.BuildWrapper.API&Language.Haskell.BuildWrapper.Packages(Language.Haskell.BuildWrapper.GHCStorageGHCMessages!Language.Haskell.BuildWrapper.Src CabalPackagecp_name cp_version cp_exposed cp_dependent cp_modulesCabalComponent CCTestSuite cc_test_name CCExecutable cc_exe_name CCLibrary cc_buildable Verbosity DeafeningVerboseNormalSilent ThingAtPointtapName tapModuletapTypetapQTypetapHTypetapGType BuildFlagsbf_ast bf_preproc bf_modName OutlineResult or_outline or_exports or_imports ImportDefi_modulei_loc i_qualifiedi_hidingi_alias i_children ImportSpecDefis_nameis_typeis_loc is_children ExportDefe_namee_typee_loc e_childrenImportExportTypeIEModule IEThingWith IEThingAllIEAbsIEVarTokenDeftd_nametd_loc OutlineDefod_nameod_typeod_loc od_children od_signature od_comment InFileSpan ifs_startifs_end InFileLocifl_line ifl_columnOutlineDefTypeSplice ConstructorFieldInstanceTypeSynPatternFunctionFamilyDataClass WhichCabalTargetSource BuildResultOpResultBWNote bwn_status bwn_title bwn_location BWLocationbwl_srcbwl_linebwl_col BWNoteStatus BWWarningBWErrorBuildWrapperState tempFolder cabalPath cabalFile verbosity cabalFlags cabalOpts BuildWrapper isBWNoteError mkFileSpan mkOutlineDefmkOutlineDefWithChildrengetFullTempDir getDistDir getTargetPathcanonicalizeFullPath getFullSrc copyFromMain fileToModulegetRecursiveContents fromJustDebug removeBaseDirCabalBuildInfo cbiBuildInfocbiComponentBuildInfocbiBuildFolder cbiIsLibrarycbiModulePathsgetFilesToCopycabalV cabalBuild cabalBuild'cabalConfigure getCabalFile cabalInit withCabalparseCabalMessagessetupExe dropPrefixesstripPrefixIfNeeded addCurrentcabalErrorLineparseBuildMessagesvalidLocreadIntmakeNote getBuiltPathcanonicalizeBuildInfoonModulePathsM onModulePaths getBuildInfofileGhcOptionsfileCppOptionscabalExtensions getSourceDirs getAllFilesgetReferencedFilesmoduleToStringcabalComponentscabalDependencies dependenciescabalComponentsFromDescription PPBehaviorStartIndentContinuegetASTwithAST withJSONAST withASTNotesghcMessagesToNotesgetGhcNamesInScopegetThingAtPointJSONghcSpanToLocationghcSpanToBWLocationghcColToScionColscionColToGhcColghctokensArbitrarylexLoc lexerFlags ofInterest tokenToTypetokenTypesArbitrary occurrencesgenerateTokenspreprocessSourceghcErrMsgToNoteghcWarnMsgToNote ghcMsgToNote removeStatusmkUnqualTokenValuemkQualifiedTokenValue mkTokenName tokenTypedotFS tokenValuestartend synchronize synchronize1write configurebuildbuild1preproc getBuildFlags getGHCAST withGHCAST withGHCAST' getOutline getTokenTypesgetOccurrencesgetThingAtPointgetNamesInScopegetCabalDependenciesgetCabalComponents getPkgInfos$fFromJSONCabalPackage$fToJSONCabalPackage$fFromJSONCabalComponent$fToJSONCabalComponent$fFromJSONThingAtPoint$fToJSONThingAtPoint$fFromJSONBuildFlags$fToJSONBuildFlags$fFromJSONOutlineResult$fToJSONOutlineResult$fFromJSONImportDef$fToJSONImportDef$fFromJSONImportSpecDef$fToJSONImportSpecDef$fFromJSONExportDef$fToJSONExportDef$fFromJSONImportExportType$fToJSONImportExportType$fFromJSONTokenDef$fToJSONTokenDef$fFromJSONOutlineDef$fToJSONOutlineDef$fFromJSONInFileSpan$fToJSONInFileSpan$fFromJSONOutlineDefType$fToJSONOutlineDefType$fFromJSONBuildResult$fToJSONBuildResult$fFromJSONBWNote$fToJSONBWNote$fFromJSONBWLocation$fToJSONBWLocation$fFromJSONBWNoteStatus$fToJSONBWNoteStatusFindFunc getInfoFile clearInfostoreBuildFlagsInfo storeGHCInfo readGHCInforeadBuildFlagsInfo setStoredInforeadStoredInfo dataToJSON debugToJSONdebugFindInJSONfindInJSONFormatted findInJSONoverlapextractSourceSpanextractSourceLoc typeOfExpr reduceTypefindInJSONData substType $fMonoidBag getHSEAST getHSEOutlinebuildCommentMapgetHSEImportExportmakeSpanknownExtensionNamesnameDecl cnameDecl qnameDecl mnnameDecl