!"#$%&'()*+,-./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-Inferedi Usage structure a 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 1outline contents 2exports 3imports 4'definition of an import statement 6 module name 7 package name 8location in source file 9is the import qualified :3is the import element list for hiding or exposing ; alias name <specific import elements =#definition of an import element ?name @type Alocation in source file B#children (constructor names, etc.) Cdefinition of export Ename Ftype Glocation in source file H#children (constructor names, etc.) IType of import/export directive Jreexport module Kspecific import/ export list Limport/export everything MAbs NVar O Lexer token Qtype of token R location Selement of the outline result Uname V#types: can have several to combine Wspan in source Xchildren (constructors...) Ytype signature if any Zcomment if any ]name ^#types: can have several to combine _type signature if any `/Span inside a file, the file is known and doesn't need to be repeated bstart location c end location d3Location inside a file, the file is known and doesn't need to be repeated fline gcolumn h)type of elements for the outline t.result for building one file: success + names ,data Build1Result=Build1Result Bool [NameDef]  deriving (Show,Read,Eq) $instance ToJSON Build1Result where ( toJSON (Build1Result b ns)= object [r .= b, ns .= map toJSON ns] %instance FromJSON Build1Result where ' parseJSON (Object v) =Build1Result  $  v .: r  *  v .: ns  parseJSON _= mzero #which cabal file to use operations u1use temporary file that was saved in temp folder vuse proper file w!result: success + files impacted yesimple type encapsulating the fact the operations return along with notes generated on files za note on a source file |status of the note }message ~where the note is location of a note/error  source file line column "status of notes: error or warning the state we keep name of temporary folder path to the cabal executable path of the project cabal file verbosity of logging flags to pass cabal #extra arguments to cabal configure  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 ;delete files in temp folder but not in real folder anymore Fdebug method: fromJust with a message to display when we get Nothing ?remove a base directory from a string representing a full path #nub for Ord objects: use a set 8debug method to vaguely format JSON result to dump them   !"#$%&'()*+,-./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  !"#$%&'()*+,-./01234567  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~z{|}~ywxtvuhsrqponmlkjidefg`abc[\]^_STUVWXYZOPQRINMLKJCDEFGH=>?@AB456789:;</0123*+,-."#$%&'()!   T   ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHINMLKJOPQRSTUVWXYZ[\]^_`abcdefgh srqponmlkjitvuwxyz{|}~ !"#$%&'()*+,-./01234567 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 the component handle 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-Infered8 simple type for search function 9?get the file storing the information for the given source file :?get the file storing the information for the given source file ;remove the storage file <store the build flags =.generate the JSON from the typechecked module c this incorporates info from the renamed source with types annotations from the typechecked source >store the GHC generated AST ?!read the GHC AST as a JSON value @/read the build flags and notes as a JSON value A?utility function to store the given value under the given key B7read the top JSON value containing all the information Cwrite the usage info file Dread the usage info file Erconvert a Data into a JSON value, with specific treatment for interesting GHC AST objects, and avoiding the holes FSdebug function: shows on standard output the JSON representation of the given data G-debug searching thing at point in given data H.find in JSON AST and return the string result Ifind in JSON AST J+sort Value by position, descending K@overlap function: find whatever is at the given line and column L"extract the source span from JSON M&extract the source location from JSON N"resolve the type of an expression OJReduce 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. 89the source file :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 Athe source file +the key under which the value will be put  the value Bthe source file Cthe source file  the value Dthe source file EPQRFGH should the output be qualified? "should the output be fully typed? result of search SIthe evaluation function $the root object containing the AST JKline column T$the root object containing the AST UVLMNOW 89:;<=>?@ABCDEPQRFGHSIJKTUVLMNOW 89:;<=>?@ABCDEPQRFGHSIJKTUVLMNOW 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 all names in scope, packaged in NameDefs 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 .transform given file path to find bwinfo path the base directory  what to load the GHC options base directory  GHC messages  source path base directory  module name build options  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 X++)X  Safe-InferedY get the AST Z$get the ouline from 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 Y input text options Zthe commented AST [the commented AST \=the map: key is line, value is start column and comment text  the comment ] the AST `abc^_ YZ[\]`abc^_ YZ[\]`abc^_ 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 !generate usage information files 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, the list of files deleted 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 5should we return all files or only the changed ones? the cabal component name 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?                d      !"#$%&'()**+,-./0112345567899:;<=>?@AABCDEFFGHIJKLMNOPQQRSTTUVWXYZ[[\]^__`abbcdefghijklmnopqrsttuvvwxyzz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO P Q R S T U V W X Y Z[buildwrapper-0.6.0"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.SrcUsage usPackageusModuleusName usSectionusTypeusLocusDef LoadContents MultipleFilelmFiles SingleFilelmFilelmModule CabalPackagecpName cpVersion cpExposed cpDependent cpModulesCabalComponent CCTestSuite ccTestName CCExecutable ccExeName CCLibrary ccBuildable Verbosity DeafeningVerboseNormalSilent ThingAtPointtapName tapModuletapTypetapQTypetapHTypetapGType BuildFlagsbfAst bfPreproc bfModName OutlineResult orOutline orExports orImports ImportDefiModuleiPackageiLoc iQualifiediHidingiAlias iChildren ImportSpecDefisNameisTypeisLoc isChildren ExportDefeNameeTypeeLoc eChildrenImportExportTypeIEModule IEThingWith IEThingAllIEAbsIEVarTokenDeftdNametdLoc OutlineDefodNameodTypeodLoc odChildren odSignature odCommentNameDefndNamendType ndSignature InFileSpanifsStartifsEnd InFileLociflLine iflColumnOutlineDefTypeSplice ConstructorFieldInstanceTypeSynPatternFunctionFamilyDataClass WhichCabalTargetSource BuildResultOpResultBWNote bwnStatusbwnTitle bwnLocation BWLocationbwlSrcbwlLinebwlCol BWNoteStatus BWWarningBWErrorBuildWrapperState tempFolder cabalPath cabalFile verbosity cabalFlags cabalOpts BuildWrapper isBWNoteError ifsOverlap iflOverlap mkFileSpan mkOutlineDefmkOutlineDefWithChildrengetFullTempDir getDistDir getTargetPathcanonicalizeFullPath getFullSrc copyFromMainisSourceMoreRecent fileToModulecabalComponentName getLoadFilesgetRecursiveContents deleteGhosts fromJustDebug removeBaseDirnubOrd formatJSONCabalBuildInfo cbiBuildInfocbiComponentBuildInfocbiBuildFolder cbiIsLibrarycbiModulePaths cbiComponentgetFilesToCopycabalV cabalBuild cabalBuild'cabalConfigure getCabalFile cabalInit withCabalparseCabalMessagessetupExe dropPrefixesstripPrefixIfNeeded addCurrentcabalErrorLineparseBuildMessagesvalidLocreadIntmakeNote getBuiltPathcanonicalizeBuildInfoonModulePathsM onModulePaths getBuildInfofileGhcOptionsfileCppOptionscabalExtensions getSourceDirs getAllFilesgetReferencedFilesstringToModuleNamemoduleToStringcabalComponentscabalDependencies dependenciescabalComponentsFromDescriptioncabalComponentFromLibrarycabalComponentFromExecutablecabalComponentFromTestSuiteAliasMap PPBehaviorStartIndentContinueGHCApplyFunctiongetASTwithAST withJSONAST withASTNotesghcMessagesToNotesgetGhcNamesInScopegetGhcNameDefsInScopegetThingAtPointJSONghcSpanToLocationghcSpanToBWLocationghcColToScionColscionColToGhcColghctokensArbitrarylexLoc lexerFlags ofInterest tokenToTypetokenTypesArbitrary occurrencesgenerateTokenspreprocessSourceghcErrMsgToNoteghcWarnMsgToNote ghcMsgToNote removeStatusmkUnqualTokenValuemkQualifiedTokenValue mkTokenName tokenTypedotFS tokenValuestartendghcImportToUsage ghcLIEToUsageghcExportToUsageghcNameToUsage synchronize synchronize1write configurebuild generateUsagebuild1preproc 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$fFromJSONNameDef$fToJSONNameDef$fFromJSONInFileSpan$fToJSONInFileSpan$fFromJSONOutlineDefType$fToJSONOutlineDefType$fFromJSONBuildResult$fToJSONBuildResult$fFromJSONBWNote$fToJSONBWNote$fFromJSONBWLocation$fToJSONBWLocation$fFromJSONBWNoteStatus$fToJSONBWNoteStatusFindFunc getInfoFile getUsageFile clearInfostoreBuildFlagsInfogenerateGHCInfo storeGHCInfo readGHCInforeadBuildFlagsInfo setStoredInforeadStoredInfo setUsageInfo getUsageInfo dataToJSON debugToJSONdebugFindInJSONfindInJSONFormatted findInJSONlastPosoverlapextractSourceSpanextractSourceLoc typeOfExpr reduceType srcSpanToJSON srcLocToJSONtypesInsideTypefindInJSONData extractUsages extractName extractSource substType $fMonoidBag getHSEAST getHSEOutlinegetModuleLocationbuildCommentMapgetHSEImportExportmakeSpanknownExtensionNamesnameDecl cnameDecl qnameDecl mnnameDecl