؆      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ portable experimentalnominolo@googlemail.comThe "source" of a location. BThe location refers to something else, e.g., the command line, or  stdin. -The location refers to a position in a file. Scion',s type for source code locations (regions). /We use a custom location type for two reasons: F1. We enforce the invariant, that the file path of the location is an  absolute path. +2. Independent evolution from the GHC API. To save space, the ( type is kept abstract and uses special I cases for notes that span only one line or are only one character wide.  Use  and $ as well as the respective accessor , functions to construct and destruct nodes. 'If no reasonable can be given, use the  function, but be careful  not to call * or any other accessor function on such a  .  Represents a   which we know is absolute. Since relative  /s depend on the a current working directory we - normalise all paths to absolute paths. Use  to create  absolute file paths. -Classifies the kind (or severity) of a note. -A note from the compiler or some other tool. 5Create an absolute file path given a base directory. ?Throws an error if the first argument is not an absolute path. ;Construct a source code location from start and end point. <If the start point is after the end point, they are swapped  automatically. AConstruct a source location that does not specify a region. The G argument can be used to give some hint as to why there is no location  available. (E.g., "File not found"). =Test whether a location is valid, i.e., not constructed with . ;Return the start column. Only defined on valid locations. 9Return the end column. Only defined on valid locations. 9Return the start line. Only defined on valid locations. 7Return the end line. Only defined on valid locations. View on a (valid) location. It holds the property: $ prop_viewLoc_mkLoc s l0 c0 l1 c1 = ? viewLoc (mkLocation s l0 c0 l1 c1) == (s, l0, c0, l1, c1) Comparison function for two s. BLexicographic composition two orderings. Compare using the first ) ordering, use the second to break ties.  Convert a   to a . HThe first argument is used to normalise relative source locations to an  absolute file path. Convert   to . BThis will mix warnings and errors, but you can split them back up  by filtering the  based on the .  $    portable experimentalnominolo@googlemail.comportable experimentalnominolo@gmail.com,A definition site database. AThis is a map from names to the location of their definition and F information about the defined entity. Note that a name may refer to  multiple entities. XXX: Currently we use GHC's  # data type. However, this probably " holds on to a lot of stuff we don'&t need. It also cannot be serialised  directly. The reason it'!s done this way is that wrapping   leads K to a lot of duplicated code. Using a custom type might be useful to have E fewer dependencies on the GHC API; however it also creates problems F mapping things back into GHC API data structures. If we do this, we  should at least remember the Unique! in order to quickly look up the  original thing. 2BAny exception raised inside Scion is a subtype of this exception. G@The DynFlags as they were when Scion was started. This is used C to reset flags when opening a new project. Arguably, the GHC API * should provide calls to reset a session. H'Build info from current Cabal project. I?The current active Cabal component. This affects DynFlags and  targets. ATM, we don'&t support multiple active components. K:The currently focused module for background typechecking. L,Cached state of the background typechecker. MSource code locations. NBcan be set by the client. Only used by vim to enable special hack ^Reflect a computation in the BA monad into the   monad. _Dual to ^. See its documentation. bA fatal error. Like  ' but suggests submitting a bug report. cShorthand for  . d The empty -,. e Combine two -, s. XXX: check for duplicates? f5Return the list of defined names (the domain) of the -,. " The result is, in fact, ordered. g;Returns all the entities that the given name may refer to. L !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghiJDEFGHIJKLMNOABCPQRST<@?>=UVWXYZ[\]^_9;:4567823`ab.10/c,-defg*+h&'()% !"#$iJ !"#$!"#$%&'()'()*++,--.10//012334567856789;::;<@?>==>?@ABCBCD EFGHIJKLMNEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghiportable experimentalnominolo@gmail.comj Construct a -, for a complete module graph. CNote: All the modules mentioned in the module graph must have been 6 loaded. This is done either by a successful call to   or by a  call to  ( for each module (in dependency order). k Construct a -, for a single module only. l Construct a SiteDB% from a base directory and a list of  s. n?Dump a definition site DB to stdout. (For debugging purposes.) jklmnjklmnjklmnportable experimentalnominolo@gmail.comopqrstuvwxyz{|}~qrstuvwxyzop{|}~oppqrstuvwxyz{|}~portable experimentalnominolo@gmail.com+Lookup all the things in a certain region. DReturns the deepest leaf, together with the path to this leaf. For + example, for the following tree with root A:    A -+- B --- C  '- D --- E --- F    this function will return:    (F, [E, D, A])    If F# were missing the result is either (C, [B,A]) or (E, [D,A]). Given two good SrcSpans (see SrcLoc.isGoodSrcSpan ), returns  if the : spans overlap or, if not, the relative ordering of both.  portable experimentalnominolo@gmail.comJReduce 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. portable experimentalnominolo@gmail.comportable experimentalnominolo@gmail.com;Reset the state of the session to a defined default state.  Due to some bugs in GHC this isn')t completely possible. For example, GHC J retains instance declarations which can lead to problems when you load a 5 new module which defines a different instance. (You'll get a conflicting A instance error, which can only be resolved by re-starting GHC.) FSets the current working directory and notifies GHC about the change. 8TODO: do we want to adjust certain flags automatically? ETry to open a Cabal project. The project must already be configured ? using the same version of Cabal that Scion was build against. Use configureCabalProject- to automatically configure a project (if it  hasn't been already.) JTODO: Allow other working directories? Would require translating all the M search paths from relative to absolute paths. Furthermore, what should the  output directory be then? Throws:  * if an error occurs (e.g., not configured < project or configured with incompatible cabal version). JReturn the (configured) package description of the current Cabal project. Throws:  ' if there is no current Cabal project. =Return path to the .cabal file of the current Cabal package. JThis is useful to identify the project when communicating with Scion from I foreign code, because this does not require serialising the local build  info. Throws:  - if there is no current Cabal project or the ( current project has no .cabal file. 3Return all components of the specified Cabal file. Throws:  , if an error occurs (e.g., .cabal file does ( not exist or could not be parsed.). 5Run the steps that Cabal would call before building. Return the current . The / is the result of configuring a Cabal project, : therefore requires that we have a current Cabal project. Throws:  ' if there is no current Cabal project. -Root directory of the current Cabal project. Throws:  ' if there is no current Cabal project. Set GHC'=s dynamic flags for the given component of the current Cabal  project (see ). Throws:  ' if there is no current Cabal project.  / if the current Cabal project does not contain  the specified component. Set the targets for a GHC.load# command from the meta data of the  current Cabal project. Throws:  ' if there is no current Cabal project.  / if the current Cabal project does not contain  the specified component. =Load the specified component from the current Cabal project. Throws:  ' if there is no current Cabal project.  / if the current Cabal project does not contain  the specified component. CMake the specified component the active one. Sets the DynFlags to A those specified for the given component. Unloads the possible Throws:  ' if there is no current Cabal project.  / if the current Cabal project does not contain  the specified component. 'Return the currently active component.  Wrapper for GHC.load. %Unload whatever is currently loaded. Parses the list of Strings( as command line arguments and sets the     accordingly. ;Does not set the flags if a parse error occurs. XXX: There' s currently C no way to find out if there was an error from inside the program. 2List all components in the current cabal project. GThis can be used to present the user a list of possible items to load. Throws:  ' if there is no current Cabal project. "Set the verbosity of the GHC API. ?Takes an absolute path to a file and attempts to typecheck it. #This performs the following steps: F1. Check whether the file is actually part of the current project. It's J also currently not possible to typecheck a .hs-boot file using this E function. We simply bail out if these conditions are not met. A2. Make sure that all dependencies of the module are up to date. D3. Parse, typecheck, desugar and load the module. The last step is % necessary so that we can we don'%t have to recompile in the case that # we switch to another module. I4. If the previous step was successful, cache the results in the session L for use by source code inspection utilities. Some of the above steps : are skipped if we know that they are not necessary. HReturn whether the filepath refers to a file inside the current project  root. Return ! if there is no current project. ?Ensure that all dependencies of the module are already loaded. Sets K if it was successful.  Return the   ! that refers to the source file. 'Assumes that there is exactly one such   . &&& portable experimentalnominolo@googlemail.comSomething went wrong during cabal configure. TODO: Add more detail. ;Open or configure a Cabal project using the Cabal library. DTries to open an existing Cabal project or configures it if opening  failed. Throws:   if configuration failed. 3Configure a Cabal project using the Cabal library. &This is roughly equivalent to calling ./Setup configure on the command J line. The difference is that this makes sure to use the same version of K Cabal and the GHC API that Scion was built against. This is important to  avoid compatibility problems. <If configuration succeeded, sets it as the current project. >TODO: Figure out a way to report more helpful error messages. Throws:   if configuration failed. Do the equivalent of runghc Setup.hs args using the GHC API.  Instead of runghc5, this function uses the GHC API so that the correct . version of GHC and package database is used. 9TODO: Return exception or error message in failure case.  portable experimentalnominolo@gmail.comRun the BA  monad. -Run the session with the given static flags. IStatic flags cannot be changed during a session and can only be set once  per process4. That is, any session running in the same process @ (i.e. program) must not attempt to set the static flags again. <Which flags are static flags depends on the version of GHC. AAopqrstuvwxyz{|}~A !"#$%&'())*+,-./0123456789::;<=>??@ABBCCDEFGHHIIJKLMNOPQRSTUUVWWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~               scion-0.1Scion.Types.Notes Scion.TypesScion.Inspect.DefinitionSite Scion.UtilsScion.Inspect.FindScion.Inspect.TypeOf Scion.Inspect Scion.SessionScion.ConfigureScionbase System.IO ghc-6.10.2SrcLocErrUtilsScion.Types.ExtraInstancesTypePreludeGHCghc-prim GHC.Ordering Cabal-1.6.0.3"Distribution.Simple.LocalBuildInfoDynFlagsGHC.BoolHscTypes LocSourceOtherSrcFileSrcLocation noLocText locSource AbsFilePath toFilePathNotesNoteKind OtherNoteInfoNote WarningNote ErrorNoteNotenoteKindnoteLoc noteMessage mkAbsFilePath mkLocationmkNoLoc isValidLoc locStartCol locEndCol locStartLine locEndLineviewLocghcSpanToLocationghcErrMsgToNoteghcWarnMsgToNoteghcMessagesToNotesScionProjectConfigbuildConfigurationsfileComponentExtraFlagsscionDefaultCabalConfigFileComponentConfigurationCabalConfigurationdistDir extraArgs ScionError DefSiteDB ComponentFile ExecutableLibrarySomeScionExceptionCompilationResultcompilationSucceededcompilationNotescompilationTime BgTcCache TypecheckedParsed Verbosity DeafeningVerboseNormalSilentScionMunScionM SessionStatescionVerbosityinitialDynFlagslocalBuildInfoactiveComponentlastCompResult focusedModule bgTcCache defSiteDBclientmkSessionState liftScionMmodifySessionStategetSessionStategetssetSessionStateintToVerbosityverbosityToIntsilentnormalverbose deafening getVerbosity setVerbositymessage reflectScionM reifyScionMscionToExceptionscionFromExceptiondieHard__emptyDefSiteDBunionDefSiteDB definedNames lookupDefSite scionErroremptyScionProjectConfigmoduleGraphDefSiteDB moduleSiteDBmkSiteDBaddToDB dumpDefSiteDBScionDefaultCabalConfigthingsAroundPointmodulesInDepOrderfoldModSummaries expectJustunqualifiedForModulesecondifM lookupKey makeObjectcamelCaseMatchreadFileComponentConfigprojectConfigFileFromDirprojectConfigFromDirwriteSampleConfigparseScionProjectConfig SearchResults SearchResultFoundLitFoundCon FoundNameFoundId FoundStmt FoundExpr FoundTypeFoundPat FoundBind PosForestPosTreeNodevalchildren findHsThing deepestLeaf pathToDeepest surroundsoverlapstypeOf reduce_type subst_type typeOfResult prettyResult typeDecls classDecls familyDecls toplevelNamesComponentDoesNotExistNoCurrentCabalProjectCannotOpenCabalProjectinitialScionDynFlagsresetSessionState setWorkingDiropenCabalProjectcurrentCabalPackagecurrentCabalFilecabalProjectComponentscabalConfigurationspreprocessPackagegetLocalBuildInfoprojectRootDirsetComponentDynFlagssetComponentTargetscabalModuleNameToTarget loadComponentcabalProjectRootsetActiveComponentgetActiveComponent noLibError noExeErrorloadunloadaddCmdLineFlagsavailableComponentssetGHCVerbositybackgroundTypecheckFileisRelativeToProjectRootfilePathToProjectModuleisPartOfProjectsetContextForBGTCmodSummaryForFileremoveMessagesForFileConfigExceptionopenOrConfigureCabalProjectconfigureCabalProjectcabalSetupWithArgsrunScion runScion' GHC.IOBaseFilePathcmpLocthenCmpSrcSpanMessagesTypeRepTyThingIOGHC.Errerror undefined MonadUtilsliftIOMonadIO loadModule cmpOverlapEQLocalBuildInfoFalse ModSummary