-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Haskell development library and tool with support of autocompletion, symbol info, go to declaration, find references etc. -- -- Haskell development library and tool with support of autocompletion, -- symbol info, go to declaration, find references, hayoo search etc. @package hsdev @version 0.1.5.1 module HsDev.Tools.Ghc.Prelude reduce :: ([a] -> a) -> [a] -> [a] one :: a -> [a] trim :: String -> String rx :: String -> String -> Maybe String srx :: String -> String -> String -> String splitRx :: String -> String -> [String] module HsDev.Version cabalVersion :: ExpQ module System.Directory.Watcher -- | Event type data EventType Added :: EventType Modified :: EventType Removed :: EventType -- | Event data Event Event :: EventType -> FilePath -> POSIXTime -> Event [_eventType] :: Event -> EventType [_eventPath] :: Event -> FilePath [_eventTime] :: Event -> POSIXTime eventType :: Lens' Event EventType eventPath :: Lens' Event FilePath eventTime :: Lens' Event POSIXTime -- | Directories watcher data Watcher a Watcher :: MVar (Map FilePath (Bool, IO ())) -> WatchManager -> Chan (a, Event) -> Watcher a -- | Map from directory to watch stopper [watcherDirs] :: Watcher a -> MVar (Map FilePath (Bool, IO ())) [watcherMan] :: Watcher a -> WatchManager [watcherChan] :: Watcher a -> Chan (a, Event) -- | Create watcher withWatcher :: (Watcher a -> IO b) -> IO b -- | Watch directory watchDir :: Watcher a -> FilePath -> (Event -> Bool) -> a -> IO () watchDir_ :: Watcher () -> FilePath -> (Event -> Bool) -> IO () -- | Unwatch directory, return False, if not watched unwatchDir :: Watcher a -> FilePath -> IO Bool -- | Check if dir is watching isWatchingDir :: Watcher a -> FilePath -> IO Bool -- | Watch directory tree watchTree :: Watcher a -> FilePath -> (Event -> Bool) -> a -> IO () watchTree_ :: Watcher () -> FilePath -> (Event -> Bool) -> IO () -- | Unwatch directory tree unwatchTree :: Watcher a -> FilePath -> IO Bool -- | Check if tree is watching isWatchingTree :: Watcher a -> FilePath -> IO Bool -- | Read next event readEvent :: Watcher a -> IO (a, Event) -- | Get lazy list of events events :: Watcher a -> IO [(a, Event)] -- | Process all events onEvent :: Watcher a -> (a -> Event -> IO ()) -> IO () instance GHC.Show.Show System.Directory.Watcher.EventType instance GHC.Read.Read System.Directory.Watcher.EventType instance GHC.Enum.Bounded System.Directory.Watcher.EventType instance GHC.Enum.Enum System.Directory.Watcher.EventType instance GHC.Classes.Ord System.Directory.Watcher.EventType instance GHC.Classes.Eq System.Directory.Watcher.EventType module System.Directory.Paths -- | Something with paths inside class Paths a paths :: Paths a => Traversal' a FilePath -- | Canonicalize all paths canonicalize :: Paths a => a -> IO a instance System.Directory.Paths.Paths GHC.IO.FilePath module HsDev.Util -- | Run action with current directory set withCurrentDirectory :: FilePath -> IO a -> IO a -- | Get directory contents safely directoryContents :: FilePath -> IO [FilePath] -- | Collect all file names in directory recursively traverseDirectory :: FilePath -> IO [FilePath] -- | Search something up searchPath :: (MonadIO m, MonadPlus m) => FilePath -> (FilePath -> m a) -> m a -- | Is one path parent of another isParent :: FilePath -> FilePath -> Bool -- | Is haskell source? haskellSource :: FilePath -> Bool -- | Is cabal file? cabalFile :: FilePath -> Bool -- | Add N tabs to line tab :: Int -> String -> String -- | Add N tabs to multiline tabs :: Int -> String -> String -- | Trim string trim :: String -> String -- | Split list split :: (a -> Bool) -> [a] -> [[a]] -- | nub is quadratic, https://github.com/nh2/haskell-ordnub/#ordnub ordNub :: Ord a => [a] -> [a] uniqueBy :: Ord b => (a -> b) -> [a] -> [a] mapBy :: Ord b => (a -> b) -> [a] -> Map b a -- | Workaround, sometimes we get HM.lookup "foo" v == Nothing, but lookup -- "foo" (HM.toList v) == Just smth (.::) :: FromJSON a => HashMap Text Value -> Text -> Parser a (.::?) :: FromJSON a => HashMap Text Value -> Text -> Parser (Maybe a) -- | Union two JSON objects objectUnion :: Value -> Value -> Value -- | Union two JSON objects jsonUnion :: (ToJSON a, ToJSON b) => a -> b -> Value -- | Lift IO exception to ExceptT liftException :: MonadCatch m => m a -> ExceptT String m a -- | Same as liftException liftE :: MonadCatch m => m a -> ExceptT String m a -- | liftE for IO liftEIO :: (MonadCatch m, MonadIO m) => IO a -> ExceptT String m a -- | Run actions ignoring errors tries :: MonadPlus m => [m a] -> m [a] triesMap :: MonadPlus m => (a -> m b) -> [a] -> m [b] -- | Lift IO exception to MonadError liftExceptionM :: (MonadCatch m, MonadError String m) => m a -> m a -- | Lift IO exceptions to ExceptT liftIOErrors :: MonadCatch m => ExceptT String m a -> ExceptT String m a eitherT :: (Monad m, MonadError String m) => Either String a -> m a -- | Throw error as exception liftThrow :: (Show e, MonadError e m, MonadCatch m) => m a -> m a fromUtf8 :: ByteString -> String toUtf8 :: String -> ByteString -- | Read file in UTF8 readFileUtf8 :: FilePath -> IO String writeFileUtf8 :: FilePath -> String -> IO () hGetLineBS :: Handle -> IO ByteString logException :: String -> (String -> IO ()) -> IO () -> IO () logIO :: String -> (String -> IO ()) -> IO () -> IO () ignoreIO :: IO () -> IO () logAsync :: (String -> IO ()) -> IO () -> IO () liftAsync :: (MonadThrow m, MonadCatch m, MonadIO m) => IO (Async a) -> ExceptT String m a class FromCmd a cmdP :: FromCmd a => Parser a cmdJson :: String -> [Pair] -> Value withCmd :: String -> (Object -> Parser a) -> Value -> Parser a guardCmd :: String -> Object -> Parser () -- | Add help command to parser withHelp :: Parser a -> Parser a -- | Subcommand cmd :: String -> String -> Parser a -> Mod CommandFields a -- | Parse arguments or return help parseArgs :: String -> ParserInfo a -> [String] -> Either String a -- | Monads in which IO computations may be embedded. Any monad -- built by applying a sequence of monad transformers to the IO -- monad will be an instance of this class. -- -- Instances should satisfy the following laws, which state that -- liftIO is a transformer of monads: -- --
class Monad m => MonadIO (m :: * -> *) -- | Lift a computation from the IO monad. liftIO :: MonadIO m => IO a -> m a module HsDev.Cabal -- | Cabal or sandbox data Cabal Cabal :: Cabal Sandbox :: FilePath -> Cabal -- | Get sandbox sandbox :: Cabal -> Maybe FilePath -- | Is -package-db file isPackageDb :: FilePath -> Bool -- | Find -package-db path for sandbox directory or package-db file itself findPackageDb :: FilePath -> IO (Maybe FilePath) -- | Create sandbox by directory or package-db file locateSandbox :: FilePath -> ExceptT String IO Cabal -- | Try find sandbox by parent directory getSandbox :: FilePath -> IO Cabal -- | Search sandbox searchSandbox :: FilePath -> IO Cabal -- | Cabal ghc option cabalOpt :: Cabal -> [String] instance GHC.Classes.Ord HsDev.Cabal.Cabal instance GHC.Classes.Eq HsDev.Cabal.Cabal instance Control.DeepSeq.NFData HsDev.Cabal.Cabal instance GHC.Show.Show HsDev.Cabal.Cabal instance Data.Aeson.Types.Class.ToJSON HsDev.Cabal.Cabal instance Data.Aeson.Types.Class.FromJSON HsDev.Cabal.Cabal module HsDev.Server.Message -- | Message with id to link request and response data Message a Message :: Maybe String -> a -> Message a [messageId] :: Message a -> Maybe String [message] :: Message a -> a -- | Get messages by id messagesById :: Maybe String -> [Message a] -> [a] -- | Notification from server data Notification Notification :: Value -> Notification -- | Result from server data Result -- | Result Result :: Value -> Result -- | Error Error :: String -> (Map String Value) -> Result -- | Part of result list, returns via notification data ResultPart ResultPart :: Value -> ResultPart type Response = Either Notification Result isNotification :: Response -> Bool notification :: ToJSON a => a -> Response result :: ToJSON a => a -> Response responseError :: String -> [Pair] -> Response resultPart :: ToJSON a => a -> Notification groupResponses :: [Response] -> [([Notification], Result)] responsesById :: Maybe String -> [Message Response] -> [([Notification], Result)] instance GHC.Base.Functor HsDev.Server.Message.Message instance GHC.Classes.Ord a => GHC.Classes.Ord (HsDev.Server.Message.Message a) instance GHC.Classes.Eq a => GHC.Classes.Eq (HsDev.Server.Message.Message a) instance Data.Aeson.Types.Class.ToJSON a => Data.Aeson.Types.Class.ToJSON (HsDev.Server.Message.Message a) instance Data.Aeson.Types.Class.FromJSON a => Data.Aeson.Types.Class.FromJSON (HsDev.Server.Message.Message a) instance Data.Foldable.Foldable HsDev.Server.Message.Message instance Data.Traversable.Traversable HsDev.Server.Message.Message instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Message.Notification instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Message.Notification instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Message.Result instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Message.Result instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Message.ResultPart instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Message.ResultPart instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Message.Response instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Message.Response module HsDev.Tools.ClearImports -- | Dump minimal imports dumpMinimalImports :: [String] -> FilePath -> ExceptT String IO String -- | Read imports from file waitImports :: FilePath -> IO [String] -- | Clean temporary files cleanTmpImports :: FilePath -> IO () -- | Dump and read imports findMinimalImports :: [String] -> FilePath -> ExceptT String IO [String] -- | Groups several lines related to one import by indents groupImports :: [String] -> [[String]] -- | Split import to import and import-list splitImport :: [String] -> (String, String) -- | Returns minimal imports for file specified clearImports :: [String] -> FilePath -> ExceptT String IO [(String, String)] module HsDev.Project -- | Cabal project data Project Project :: String -> FilePath -> FilePath -> Maybe ProjectDescription -> Project [_projectName] :: Project -> String [_projectPath] :: Project -> FilePath [_projectCabal] :: Project -> FilePath [_projectDescription] :: Project -> Maybe ProjectDescription data ProjectDescription ProjectDescription :: Maybe Library -> [Executable] -> [Test] -> ProjectDescription [_projectLibrary] :: ProjectDescription -> Maybe Library [_projectExecutables] :: ProjectDescription -> [Executable] [_projectTests] :: ProjectDescription -> [Test] class Target a buildInfo :: Target a => a -> Info -- | Library in project data Library Library :: [[String]] -> Info -> Library [_libraryModules] :: Library -> [[String]] [_libraryBuildInfo] :: Library -> Info -- | Executable data Executable Executable :: String -> FilePath -> Info -> Executable [_executableName] :: Executable -> String [_executablePath] :: Executable -> FilePath [_executableBuildInfo] :: Executable -> Info -- | Test data Test Test :: String -> Bool -> Info -> Test [_testName] :: Test -> String [_testEnabled] :: Test -> Bool [_testBuildInfo] :: Test -> Info -- | Build info data Info Info :: [String] -> Maybe Language -> [Extension] -> [String] -> [FilePath] -> Info [_infoDepends] :: Info -> [String] [_infoLanguage] :: Info -> Maybe Language [_infoExtensions] :: Info -> [Extension] [_infoGHCOptions] :: Info -> [String] [_infoSourceDirs] :: Info -> [FilePath] -- | infoSourceDirs lens with default infoSourceDirsDef :: Simple Lens Info [FilePath] -- | Read project info from .cabal readProject :: FilePath -> ExceptT String IO Project -- | Load project description loadProject :: Project -> ExceptT String IO Project -- | Find project sandbox getProjectSandbox :: Project -> IO Cabal -- | Make project by .cabal file project :: FilePath -> Project -- | Entity with project extensions data Extensions a Extensions :: [Extension] -> [String] -> a -> Extensions a [_extensions] :: Extensions a -> [Extension] [_ghcOptions] :: Extensions a -> [String] [_entity] :: Extensions a -> a -- | Extensions for target withExtensions :: a -> Info -> Extensions a -- | Returns build targets infos infos :: ProjectDescription -> [Info] -- | Check if source related to target, source must be relative to project -- directory inTarget :: FilePath -> Info -> Bool -- | Get possible targets for source file There can be many candidates in -- case of module related to several executables or tests fileTargets :: Project -> FilePath -> [Info] -- | Finds source dir file belongs to findSourceDir :: Project -> FilePath -> Maybe (Extensions FilePath) -- | Returns source dirs for library, executables and tests sourceDirs :: ProjectDescription -> [Extensions FilePath] projectName :: Lens' Project String projectPath :: Lens' Project FilePath projectCabal :: Lens' Project FilePath projectDescription :: Lens' Project (Maybe ProjectDescription) projectLibrary :: Lens' ProjectDescription (Maybe Library) projectExecutables :: Lens' ProjectDescription [Executable] projectTests :: Lens' ProjectDescription [Test] libraryModules :: Lens' Library [[String]] libraryBuildInfo :: Lens' Library Info executableName :: Lens' Executable String executablePath :: Lens' Executable FilePath executableBuildInfo :: Lens' Executable Info testName :: Lens' Test String testEnabled :: Lens' Test Bool testBuildInfo :: Lens' Test Info infoDepends :: Lens' Info [String] infoLanguage :: Lens' Info (Maybe Language) infoExtensions :: Lens' Info [Extension] infoGHCOptions :: Lens' Info [String] infoSourceDirs :: Lens' Info [FilePath] extensions :: Lens' (Extensions a_aRNb) [Extension] ghcOptions :: Lens' (Extensions a_aRNb) [String] entity :: Lens (Extensions a_aRNb) (Extensions a_aUlr) a_aRNb a_aUlr -- | Extension as flag name showExtension :: Extension -> String -- | Convert -Xext to ext flagExtension :: String -> Maybe String -- | Convert ext to -Xext extensionFlag :: String -> String -- | Extensions as opts to GHC extensionsOpts :: Extensions a -> [String] instance GHC.Show.Show a => GHC.Show.Show (HsDev.Project.Extensions a) instance GHC.Read.Read a => GHC.Read.Read (HsDev.Project.Extensions a) instance GHC.Classes.Eq a => GHC.Classes.Eq (HsDev.Project.Extensions a) instance GHC.Read.Read HsDev.Project.Project instance GHC.Read.Read HsDev.Project.ProjectDescription instance GHC.Classes.Eq HsDev.Project.ProjectDescription instance GHC.Read.Read HsDev.Project.Library instance GHC.Classes.Eq HsDev.Project.Library instance GHC.Read.Read HsDev.Project.Executable instance GHC.Classes.Eq HsDev.Project.Executable instance GHC.Read.Read HsDev.Project.Test instance GHC.Classes.Eq HsDev.Project.Test instance GHC.Read.Read HsDev.Project.Info instance GHC.Classes.Eq HsDev.Project.Info instance Control.DeepSeq.NFData HsDev.Project.Project instance GHC.Classes.Eq HsDev.Project.Project instance GHC.Classes.Ord HsDev.Project.Project instance GHC.Show.Show HsDev.Project.Project instance Data.Aeson.Types.Class.ToJSON HsDev.Project.Project instance Data.Aeson.Types.Class.FromJSON HsDev.Project.Project instance GHC.Show.Show HsDev.Project.ProjectDescription instance Data.Aeson.Types.Class.ToJSON HsDev.Project.ProjectDescription instance Data.Aeson.Types.Class.FromJSON HsDev.Project.ProjectDescription instance HsDev.Project.Target HsDev.Project.Library instance GHC.Show.Show HsDev.Project.Library instance Data.Aeson.Types.Class.ToJSON HsDev.Project.Library instance Data.Aeson.Types.Class.FromJSON HsDev.Project.Library instance HsDev.Project.Target HsDev.Project.Executable instance GHC.Show.Show HsDev.Project.Executable instance Data.Aeson.Types.Class.ToJSON HsDev.Project.Executable instance Data.Aeson.Types.Class.FromJSON HsDev.Project.Executable instance HsDev.Project.Target HsDev.Project.Test instance GHC.Show.Show HsDev.Project.Test instance Data.Aeson.Types.Class.ToJSON HsDev.Project.Test instance Data.Aeson.Types.Class.FromJSON HsDev.Project.Test instance GHC.Show.Show HsDev.Project.Info instance Data.Aeson.Types.Class.ToJSON HsDev.Project.Info instance Data.Aeson.Types.Class.FromJSON HsDev.Project.Info instance GHC.Classes.Ord a => GHC.Classes.Ord (HsDev.Project.Extensions a) instance GHC.Base.Functor HsDev.Project.Extensions instance GHC.Base.Applicative HsDev.Project.Extensions instance Data.Foldable.Foldable HsDev.Project.Extensions instance Data.Traversable.Traversable HsDev.Project.Extensions module HsDev.Watcher.Types data Watched WatchedProject :: Project -> [String] -> Watched WatchedSandbox :: Cabal -> [String] -> Watched WatchedModule :: Watched type Watcher = Watcher Watched -- | Cabal or sandbox data Cabal -- | Cabal project data Project module HsDev.Symbols.Location data ModulePackage ModulePackage :: String -> String -> ModulePackage [_packageName] :: ModulePackage -> String [_packageVersion] :: ModulePackage -> String -- | Location of module data ModuleLocation FileModule :: FilePath -> Maybe Project -> ModuleLocation [_moduleFile] :: ModuleLocation -> FilePath [_moduleProject] :: ModuleLocation -> Maybe Project CabalModule :: Cabal -> Maybe ModulePackage -> String -> ModuleLocation [_moduleCabal] :: ModuleLocation -> Cabal [_modulePackage] :: ModuleLocation -> Maybe ModulePackage [_cabalModuleName] :: ModuleLocation -> String ModuleSource :: Maybe String -> ModuleLocation [_moduleSourceName] :: ModuleLocation -> Maybe String moduleStandalone :: ModuleLocation -> Bool locationId :: ModuleLocation -> String noLocation :: ModuleLocation data Position Position :: Int -> Int -> Position [_positionLine] :: Position -> Int [_positionColumn] :: Position -> Int data Region Region :: Position -> Position -> Region [_regionFrom] :: Region -> Position [_regionTo] :: Region -> Position region :: Position -> Position -> Region regionAt :: Position -> Region regionLines :: Region -> Int -- | Get string at region regionStr :: Region -> String -> String -- | Location of symbol data Location Location :: ModuleLocation -> Maybe Position -> Location [_locationModule] :: Location -> ModuleLocation [_locationPosition] :: Location -> Maybe Position packageName :: Lens' ModulePackage String packageVersion :: Lens' ModulePackage String moduleFile :: Traversal' ModuleLocation FilePath moduleProject :: Traversal' ModuleLocation (Maybe Project) moduleCabal :: Traversal' ModuleLocation Cabal modulePackage :: Traversal' ModuleLocation (Maybe ModulePackage) cabalModuleName :: Traversal' ModuleLocation String moduleSourceName :: Traversal' ModuleLocation (Maybe String) positionLine :: Lens' Position Int positionColumn :: Lens' Position Int regionFrom :: Lens' Region Position regionTo :: Lens' Region Position locationModule :: Lens' Location ModuleLocation locationPosition :: Lens' Location (Maybe Position) -- | Get source module root directory, i.e. for "...srcFooBar.hs" with -- module Bar will return "...src" sourceModuleRoot :: Text -> FilePath -> FilePath -- | Get path of imported module >importedModulePath Foo.Bar -- "...srcFooBar.hs" Quux.Blah = "...srcQuuxBlah.hs" importedModulePath :: Text -> FilePath -> Text -> FilePath packageOpt :: Maybe ModulePackage -> [String] -- | Recalc positions to interpret '\t' as one symbol instead of N class RecalcTabs a -- | Interpret '\t' as one symbol instead of N recalcTabs :: RecalcTabs a => String -> Int -> a -> a -- | Inverse of recalcTabs: interpret '\t' as N symbols instead of 1 calcTabs :: RecalcTabs a => String -> Int -> a -> a instance Control.DeepSeq.NFData HsDev.Symbols.Location.Location instance GHC.Show.Show HsDev.Symbols.Location.Location instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Location.Location instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Location.Location instance HsDev.Symbols.Location.RecalcTabs HsDev.Symbols.Location.Position instance HsDev.Symbols.Location.RecalcTabs HsDev.Symbols.Location.Region instance GHC.Classes.Ord HsDev.Symbols.Location.Location instance GHC.Classes.Eq HsDev.Symbols.Location.Location instance Control.DeepSeq.NFData HsDev.Symbols.Location.Region instance GHC.Show.Show HsDev.Symbols.Location.Region instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Location.Region instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Location.Region instance GHC.Read.Read HsDev.Symbols.Location.Region instance GHC.Classes.Ord HsDev.Symbols.Location.Region instance GHC.Classes.Eq HsDev.Symbols.Location.Region instance Control.DeepSeq.NFData HsDev.Symbols.Location.Position instance GHC.Show.Show HsDev.Symbols.Location.Position instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Location.Position instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Location.Position instance GHC.Read.Read HsDev.Symbols.Location.Position instance GHC.Classes.Ord HsDev.Symbols.Location.Position instance GHC.Classes.Eq HsDev.Symbols.Location.Position instance Control.DeepSeq.NFData HsDev.Symbols.Location.ModuleLocation instance GHC.Show.Show HsDev.Symbols.Location.ModuleLocation instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Location.ModuleLocation instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Location.ModuleLocation instance GHC.Classes.Ord HsDev.Symbols.Location.ModuleLocation instance GHC.Classes.Eq HsDev.Symbols.Location.ModuleLocation instance Control.DeepSeq.NFData HsDev.Symbols.Location.ModulePackage instance GHC.Show.Show HsDev.Symbols.Location.ModulePackage instance GHC.Read.Read HsDev.Symbols.Location.ModulePackage instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Location.ModulePackage instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Location.ModulePackage instance GHC.Classes.Ord HsDev.Symbols.Location.ModulePackage instance GHC.Classes.Eq HsDev.Symbols.Location.ModulePackage module HsDev.Display class Display a display :: Display a => a -> String displayType :: Display a => a -> String instance HsDev.Display.Display HsDev.Cabal.Cabal instance HsDev.Display.Display HsDev.Symbols.Location.ModuleLocation instance HsDev.Display.Display HsDev.Project.Project instance HsDev.Display.Display GHC.IO.FilePath instance Text.Format.FormatBuild HsDev.Cabal.Cabal instance Text.Format.FormatBuild HsDev.Symbols.Location.ModuleLocation instance Text.Format.FormatBuild HsDev.Project.Project module HsDev.Symbols.Class class Symbol a symbolName :: Symbol a => a -> Text symbolQualifiedName :: Symbol a => a -> Text symbolDocs :: Symbol a => a -> Maybe Text symbolLocation :: Symbol a => a -> Location symbolModuleLocation :: Symbol a => a -> ModuleLocation module HsDev.Symbols.Documented -- | Documented symbol class Symbol a => Documented a where detailed = unlines . defaultDetailed brief :: Documented a => a -> String detailed :: Documented a => a -> String -- | Default detailed docs defaultDetailed :: Documented a => a -> [String] module HsDev.Symbols.Types -- | What to export for data/class etc data ExportPart ExportNothing :: ExportPart ExportAll :: ExportPart ExportWith :: [Text] -> ExportPart -- | Module export data Export ExportName :: Maybe Text -> Text -> ExportPart -> Export [_exportQualified] :: Export -> Maybe Text [_exportName] :: Export -> Text [_exportPart] :: Export -> ExportPart ExportModule :: Text -> Export [_exportModule] :: Export -> Text -- | Import list data ImportList ImportList :: Bool -> [Text] -> ImportList [_hidingList] :: ImportList -> Bool [_importSpec] :: ImportList -> [Text] -- | Module import data Import Import :: Text -> Bool -> Maybe Text -> Maybe ImportList -> Maybe Position -> Import [_importModuleName] :: Import -> Text [_importIsQualified] :: Import -> Bool [_importAs] :: Import -> Maybe Text [_importList] :: Import -> Maybe ImportList [_importPosition] :: Import -> Maybe Position -- | Module id data ModuleId ModuleId :: Text -> ModuleLocation -> ModuleId [_moduleIdName] :: ModuleId -> Text [_moduleIdLocation] :: ModuleId -> ModuleLocation -- | Module data Module Module :: Text -> Maybe Text -> ModuleLocation -> Maybe [Export] -> [Import] -> [Declaration] -> Module [_moduleName] :: Module -> Text [_moduleDocs] :: Module -> Maybe Text [_moduleLocation] :: Module -> ModuleLocation [_moduleExports] :: Module -> Maybe [Export] [_moduleImports] :: Module -> [Import] [_moduleDeclarations] :: Module -> [Declaration] -- | Module contents moduleContents :: Module -> [String] moduleId :: Simple Lens Module ModuleId -- | Declaration data Declaration Declaration :: Text -> Maybe ModuleId -> Maybe [Import] -> Maybe Text -> Maybe Position -> DeclarationInfo -> Declaration [_declarationName] :: Declaration -> Text -- | Where declaration defined, Nothing if here [_declarationDefined] :: Declaration -> Maybe ModuleId -- | Declaration imported with. Nothing if unknown (cabal modules) -- or here (source file) [_declarationImported] :: Declaration -> Maybe [Import] [_declarationDocs] :: Declaration -> Maybe Text [_declarationPosition] :: Declaration -> Maybe Position [_declaration] :: Declaration -> DeclarationInfo -- | Common info for type, newtype, data and class data TypeInfo TypeInfo :: Maybe Text -> [Text] -> Maybe Text -> [Text] -> TypeInfo [_typeInfoContext] :: TypeInfo -> Maybe Text [_typeInfoArgs] :: TypeInfo -> [Text] [_typeInfoDefinition] :: TypeInfo -> Maybe Text [_typeInfoFunctions] :: TypeInfo -> [Text] showTypeInfo :: TypeInfo -> String -> String -> String -- | Declaration info data DeclarationInfo Function :: Maybe Text -> [Declaration] -> Maybe Text -> DeclarationInfo [_functionType] :: DeclarationInfo -> Maybe Text [_localDeclarations] :: DeclarationInfo -> [Declaration] [_related] :: DeclarationInfo -> Maybe Text Type :: TypeInfo -> DeclarationInfo [_typeInfo] :: DeclarationInfo -> TypeInfo NewType :: TypeInfo -> DeclarationInfo [_typeInfo] :: DeclarationInfo -> TypeInfo Data :: TypeInfo -> DeclarationInfo [_typeInfo] :: DeclarationInfo -> TypeInfo Class :: TypeInfo -> DeclarationInfo [_typeInfo] :: DeclarationInfo -> TypeInfo -- | Get function type of type info declarationInfo :: DeclarationInfo -> Either (Maybe Text, [Declaration], Maybe Text) TypeInfo declarationTypeCtor :: String -> TypeInfo -> DeclarationInfo declarationTypeName :: DeclarationInfo -> Maybe String -- | Symbol in context of some module data ModuleDeclaration ModuleDeclaration :: ModuleId -> Declaration -> ModuleDeclaration [_declarationModuleId] :: ModuleDeclaration -> ModuleId [_moduleDeclaration] :: ModuleDeclaration -> Declaration -- | Symbol exported with data ExportedDeclaration ExportedDeclaration :: [ModuleId] -> Declaration -> ExportedDeclaration [_exportedBy] :: ExportedDeclaration -> [ModuleId] [_exportedDeclaration] :: ExportedDeclaration -> Declaration -- | Inspection data data Inspection -- | No inspection InspectionNone :: Inspection -- | Time and flags of inspection InspectionAt :: POSIXTime -> [String] -> Inspection [_inspectionAt] :: Inspection -> POSIXTime [_inspectionOpts] :: Inspection -> [String] -- | Inspected entity data Inspected i a Inspected :: Inspection -> i -> Either String a -> Inspected i a [_inspection] :: Inspected i a -> Inspection [_inspectedId] :: Inspected i a -> i [_inspectionResult] :: Inspected i a -> Either String a -- | Inspected module type InspectedModule = Inspected ModuleLocation Module exportQualified :: Traversal' Export (Maybe Text) exportName :: Traversal' Export Text exportPart :: Traversal' Export ExportPart exportModule :: Traversal' Export Text hidingList :: Lens' ImportList Bool importSpec :: Lens' ImportList [Text] importModuleName :: Lens' Import Text importIsQualified :: Lens' Import Bool importAs :: Lens' Import (Maybe Text) importList :: Lens' Import (Maybe ImportList) importPosition :: Lens' Import (Maybe Position) moduleIdName :: Lens' ModuleId Text moduleIdLocation :: Lens' ModuleId ModuleLocation moduleName :: Lens' Module Text moduleDocs :: Lens' Module (Maybe Text) moduleLocation :: Lens' Module ModuleLocation moduleExports :: Lens' Module (Maybe [Export]) moduleImports :: Lens' Module [Import] moduleDeclarations :: Lens' Module [Declaration] declarationName :: Lens' Declaration Text declarationDefined :: Lens' Declaration (Maybe ModuleId) declarationImported :: Lens' Declaration (Maybe [Import]) declarationDocs :: Lens' Declaration (Maybe Text) declarationPosition :: Lens' Declaration (Maybe Position) declaration :: Lens' Declaration DeclarationInfo typeInfoContext :: Lens' TypeInfo (Maybe Text) typeInfoArgs :: Lens' TypeInfo [Text] typeInfoDefinition :: Lens' TypeInfo (Maybe Text) typeInfoFunctions :: Lens' TypeInfo [Text] functionType :: Traversal' DeclarationInfo (Maybe Text) localDeclarations :: Traversal' DeclarationInfo [Declaration] related :: Traversal' DeclarationInfo (Maybe Text) typeInfo :: Traversal' DeclarationInfo TypeInfo declarationModuleId :: Lens' ModuleDeclaration ModuleId moduleDeclaration :: Lens' ModuleDeclaration Declaration exportedBy :: Lens' ExportedDeclaration [ModuleId] exportedDeclaration :: Lens' ExportedDeclaration Declaration inspectionAt :: Traversal' Inspection POSIXTime inspectionOpts :: Traversal' Inspection [String] inspection :: Lens' (Inspected i_a14a8 a_a14a9) Inspection inspectedId :: Lens (Inspected i_a14a8 a_a14a9) (Inspected i_a166i a_a14a9) i_a14a8 i_a166i inspectionResult :: Lens (Inspected i_a14a8 a_a14a9) (Inspected i_a14a8 a_a166j) (Either String a_a14a9) (Either String a_a166j) instance (GHC.Classes.Ord i, GHC.Classes.Ord a) => GHC.Classes.Ord (HsDev.Symbols.Types.Inspected i a) instance (GHC.Classes.Eq i, GHC.Classes.Eq a) => GHC.Classes.Eq (HsDev.Symbols.Types.Inspected i a) instance GHC.Classes.Ord HsDev.Symbols.Types.Inspection instance GHC.Classes.Eq HsDev.Symbols.Types.Inspection instance GHC.Classes.Ord HsDev.Symbols.Types.ExportedDeclaration instance GHC.Classes.Eq HsDev.Symbols.Types.ExportedDeclaration instance GHC.Classes.Ord HsDev.Symbols.Types.ModuleDeclaration instance GHC.Classes.Eq HsDev.Symbols.Types.ModuleDeclaration instance GHC.Classes.Ord HsDev.Symbols.Types.Module instance GHC.Classes.Ord HsDev.Symbols.Types.Declaration instance GHC.Classes.Eq HsDev.Symbols.Types.Declaration instance GHC.Classes.Ord HsDev.Symbols.Types.DeclarationInfo instance GHC.Show.Show HsDev.Symbols.Types.TypeInfo instance GHC.Read.Read HsDev.Symbols.Types.TypeInfo instance GHC.Classes.Ord HsDev.Symbols.Types.TypeInfo instance GHC.Classes.Eq HsDev.Symbols.Types.TypeInfo instance GHC.Classes.Ord HsDev.Symbols.Types.ModuleId instance GHC.Classes.Eq HsDev.Symbols.Types.ModuleId instance GHC.Classes.Ord HsDev.Symbols.Types.Import instance GHC.Classes.Eq HsDev.Symbols.Types.Import instance GHC.Classes.Ord HsDev.Symbols.Types.ImportList instance GHC.Classes.Eq HsDev.Symbols.Types.ImportList instance GHC.Classes.Ord HsDev.Symbols.Types.Export instance GHC.Classes.Eq HsDev.Symbols.Types.Export instance GHC.Classes.Ord HsDev.Symbols.Types.ExportPart instance GHC.Classes.Eq HsDev.Symbols.Types.ExportPart instance Control.DeepSeq.NFData HsDev.Symbols.Types.ExportPart instance GHC.Show.Show HsDev.Symbols.Types.ExportPart instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.ExportPart instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.ExportPart instance Control.DeepSeq.NFData HsDev.Symbols.Types.Export instance GHC.Show.Show HsDev.Symbols.Types.Export instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.Export instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.Export instance Control.DeepSeq.NFData HsDev.Symbols.Types.ImportList instance GHC.Show.Show HsDev.Symbols.Types.ImportList instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.ImportList instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.ImportList instance Control.DeepSeq.NFData HsDev.Symbols.Types.Import instance GHC.Show.Show HsDev.Symbols.Types.Import instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.Import instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.Import instance Control.DeepSeq.NFData HsDev.Symbols.Types.ModuleId instance GHC.Show.Show HsDev.Symbols.Types.ModuleId instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.ModuleId instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.ModuleId instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.Module instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.Module instance Control.DeepSeq.NFData HsDev.Symbols.Types.Module instance GHC.Classes.Eq HsDev.Symbols.Types.Module instance GHC.Show.Show HsDev.Symbols.Types.Module instance Control.DeepSeq.NFData HsDev.Symbols.Types.Declaration instance GHC.Show.Show HsDev.Symbols.Types.Declaration instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.Declaration instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.Declaration instance Control.DeepSeq.NFData HsDev.Symbols.Types.TypeInfo instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.TypeInfo instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.TypeInfo instance Control.DeepSeq.NFData HsDev.Symbols.Types.DeclarationInfo instance GHC.Classes.Eq HsDev.Symbols.Types.DeclarationInfo instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.DeclarationInfo instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.DeclarationInfo instance Control.DeepSeq.NFData HsDev.Symbols.Types.ModuleDeclaration instance GHC.Show.Show HsDev.Symbols.Types.ModuleDeclaration instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.ModuleDeclaration instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.ModuleDeclaration instance Control.DeepSeq.NFData HsDev.Symbols.Types.ExportedDeclaration instance GHC.Show.Show HsDev.Symbols.Types.ExportedDeclaration instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.ExportedDeclaration instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.ExportedDeclaration instance Control.DeepSeq.NFData HsDev.Symbols.Types.Inspection instance GHC.Show.Show HsDev.Symbols.Types.Inspection instance GHC.Read.Read Data.Time.Clock.POSIX.POSIXTime instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.Inspection instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.Inspection instance GHC.Base.Functor (HsDev.Symbols.Types.Inspected i) instance Data.Foldable.Foldable (HsDev.Symbols.Types.Inspected i) instance Data.Traversable.Traversable (HsDev.Symbols.Types.Inspected i) instance (Control.DeepSeq.NFData i, Control.DeepSeq.NFData a) => Control.DeepSeq.NFData (HsDev.Symbols.Types.Inspected i a) instance GHC.Show.Show HsDev.Symbols.Types.InspectedModule instance Data.Aeson.Types.Class.ToJSON HsDev.Symbols.Types.InspectedModule instance Data.Aeson.Types.Class.FromJSON HsDev.Symbols.Types.InspectedModule instance HsDev.Symbols.Class.Symbol HsDev.Symbols.Types.Module instance HsDev.Symbols.Class.Symbol HsDev.Symbols.Types.ModuleId instance HsDev.Symbols.Class.Symbol HsDev.Symbols.Types.Declaration instance HsDev.Symbols.Class.Symbol HsDev.Symbols.Types.ModuleDeclaration instance HsDev.Symbols.Documented.Documented HsDev.Symbols.Types.ModuleId instance HsDev.Symbols.Documented.Documented HsDev.Symbols.Types.Module instance HsDev.Symbols.Documented.Documented HsDev.Symbols.Types.Declaration instance HsDev.Symbols.Documented.Documented HsDev.Symbols.Types.ModuleDeclaration module HsDev.Symbols -- | Get name of export export :: Export -> Text -- | Check whether name pass import list passImportList :: ImportList -> Text -> Bool -- | Get import module name importName :: Import -> Text -- | Simple import import_ :: Text -> Import class Symbol a symbolName :: Symbol a => a -> Text symbolQualifiedName :: Symbol a => a -> Text symbolDocs :: Symbol a => a -> Maybe Text symbolLocation :: Symbol a => a -> Location unnamedModuleId :: ModuleLocation -> ModuleId sortDeclarations :: [Declaration] -> [Declaration] -- | Bring locals to top moduleLocals :: Module -> Module -- | Set all declaration definedIn to this module setDefinedIn :: Module -> Module -- | Drop all declarations, that not defined in this module dropExternals :: Module -> Module -- | Clear definedIn information clearDefinedIn :: Module -> Module -- | Get declarations with locals moduleLocalDeclarations :: Module -> [Declaration] -- | Get list of declarations as ModuleDeclaration moduleModuleDeclarations :: Module -> [ModuleDeclaration] class Locals a locals :: Locals a => a -> [Declaration] where_ :: Locals a => a -> [Declaration] -> a decl :: Text -> DeclarationInfo -> Declaration definedIn :: Declaration -> ModuleId -> Declaration declarationLocals :: Declaration -> [Declaration] -- | Get scopes of Declaration, where Nothing is global -- scope scopes :: Declaration -> [Maybe Text] -- | Merge ModuleDeclaration into ExportedDeclaration mergeExported :: [ModuleDeclaration] -> [ExportedDeclaration] -- | Imported module can be accessed via qualifier importQualifier :: Maybe Text -> Import -> Bool -- | Find project file is related to locateProject :: FilePath -> IO (Maybe Project) -- | Search project up searchProject :: FilePath -> IO (Maybe Project) -- | Locate source dir of file locateSourceDir :: FilePath -> IO (Maybe (Extensions FilePath)) -- | Options for GHC of module and project moduleOpts :: [ModulePackage] -> Module -> [String] -- | Add declaration to module addDeclaration :: Declaration -> Module -> Module -- | Unalias import name unalias :: Module -> Text -> [Text] instance HsDev.Symbols.Locals HsDev.Symbols.Types.Declaration instance HsDev.Symbols.Locals HsDev.Symbols.Types.DeclarationInfo instance System.Directory.Paths.Paths HsDev.Cabal.Cabal instance System.Directory.Paths.Paths HsDev.Project.Project instance System.Directory.Paths.Paths HsDev.Symbols.Location.ModuleLocation module HsDev.Symbols.Util -- | Get module project projectOf :: ModuleId -> Maybe Project -- | Get module cabal cabalOf :: ModuleId -> Maybe Cabal -- | Get module package packageOf :: ModuleId -> Maybe ModulePackage -- | Check if module in project inProject :: Project -> ModuleId -> Bool -- | Check if module in deps of project target inDepsOfTarget :: Info -> ModuleId -> Bool -- | Check if module in deps of source inDepsOfFile :: Project -> FilePath -> ModuleId -> Bool -- | Check if module in deps of project inDepsOfProject :: Project -> ModuleId -> Bool -- | Check if module in cabal inCabal :: Cabal -> ModuleId -> Bool -- | Check if module in package inPackage :: String -> ModuleId -> Bool inVersion :: String -> ModuleId -> Bool -- | Check if module in file inFile :: FilePath -> ModuleId -> Bool -- | Check if module in source inModuleSource :: Maybe String -> ModuleId -> Bool -- | Check if declaration is in module inModule :: String -> ModuleId -> Bool -- | Check if module defined in file byFile :: ModuleId -> Bool -- | Check if module got from cabal database byCabal :: ModuleId -> Bool -- | Check if module is standalone standalone :: ModuleId -> Bool -- | Get list of imports imports :: Module -> [Import] -- | Get list of imports, which can be accessed with specified qualifier or -- unqualified qualifier :: Module -> Maybe String -> [Import] -- | Check if module imported via imports specified imported :: ModuleId -> [Import] -> Bool -- | Check if module visible from this module within this project visible :: Project -> ModuleId -> ModuleId -> Bool -- | Check if module is in scope with qualifier inScope :: Module -> Maybe String -> ModuleId -> Bool -- | Select symbols with last package version newestPackage :: Symbol a => [a] -> [a] -- | Select module, defined by sources sourceModule :: Maybe Project -> [Module] -> Maybe Module -- | Select module, visible in project or cabal visibleModule :: Cabal -> Maybe Project -> [Module] -> Maybe Module -- | Select preferred visible module preferredModule :: Cabal -> Maybe Project -> [ModuleId] -> Maybe ModuleId -- | Remove duplicate modules, leave only preferredModule uniqueModules :: Cabal -> Maybe Project -> [ModuleId] -> [ModuleId] -- | Select value, satisfying to all predicates allOf :: [a -> Bool] -> a -> Bool -- | Select value, satisfying one of predicates anyOf :: [a -> Bool] -> a -> Bool module HsDev.Tools.Types -- | Note severity data Severity Error :: Severity Warning :: Severity Hint :: Severity -- | Note over some region data Note a Note :: ModuleLocation -> Region -> Maybe Severity -> a -> Note a [_noteSource] :: Note a -> ModuleLocation [_noteRegion] :: Note a -> Region [_noteLevel] :: Note a -> Maybe Severity [_note] :: Note a -> a noteSource :: Lens' (Note a_a1i5c) ModuleLocation noteRegion :: Lens' (Note a_a1i5c) Region noteLevel :: Lens' (Note a_a1i5c) (Maybe Severity) note :: Lens (Note a_a1i5c) (Note a_a1ieK) a_a1i5c a_a1ieK -- | Output message from some tool (ghc, ghc-mod, hlint) with optional -- suggestion data OutputMessage OutputMessage :: String -> Maybe String -> OutputMessage [_message] :: OutputMessage -> String [_messageSuggestion] :: OutputMessage -> Maybe String message :: Lens' OutputMessage String messageSuggestion :: Lens' OutputMessage (Maybe String) outputMessage :: String -> OutputMessage instance GHC.Show.Show HsDev.Tools.Types.OutputMessage instance GHC.Read.Read HsDev.Tools.Types.OutputMessage instance GHC.Classes.Ord HsDev.Tools.Types.OutputMessage instance GHC.Classes.Eq HsDev.Tools.Types.OutputMessage instance GHC.Base.Functor HsDev.Tools.Types.Note instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (HsDev.Tools.Types.Note a) instance Data.Aeson.Types.Class.ToJSON a => Data.Aeson.Types.Class.ToJSON (HsDev.Tools.Types.Note a) instance Data.Aeson.Types.Class.FromJSON a => Data.Aeson.Types.Class.FromJSON (HsDev.Tools.Types.Note a) instance HsDev.Symbols.Location.RecalcTabs (HsDev.Tools.Types.Note a) instance System.Directory.Paths.Paths (HsDev.Tools.Types.Note a) instance Control.DeepSeq.NFData HsDev.Tools.Types.OutputMessage instance Data.Aeson.Types.Class.ToJSON HsDev.Tools.Types.OutputMessage instance Data.Aeson.Types.Class.FromJSON HsDev.Tools.Types.OutputMessage instance GHC.Show.Show a => GHC.Show.Show (HsDev.Tools.Types.Note a) instance GHC.Classes.Eq a => GHC.Classes.Eq (HsDev.Tools.Types.Note a) instance GHC.Show.Show HsDev.Tools.Types.Severity instance GHC.Read.Read HsDev.Tools.Types.Severity instance GHC.Classes.Ord HsDev.Tools.Types.Severity instance GHC.Classes.Eq HsDev.Tools.Types.Severity instance GHC.Enum.Bounded HsDev.Tools.Types.Severity instance GHC.Enum.Enum HsDev.Tools.Types.Severity instance Control.DeepSeq.NFData HsDev.Tools.Types.Severity instance Data.Aeson.Types.Class.ToJSON HsDev.Tools.Types.Severity instance Data.Aeson.Types.Class.FromJSON HsDev.Tools.Types.Severity module HsDev.Tools.Base type Result = Either String String type ToolM a = ExceptT String IO a -- | Run command and wait for result runWait :: FilePath -> [String] -> String -> IO Result -- | Run command with no input runWait_ :: FilePath -> [String] -> IO Result -- | Tool tool :: FilePath -> [String] -> String -> ToolM String -- | Tool with no input tool_ :: FilePath -> [String] -> ToolM String matchRx :: String -> String -> Maybe (Int -> Maybe String) splitRx :: String -> String -> [String] replaceRx :: String -> String -> String -> String at :: (Int -> Maybe String) -> Int -> String at_ :: (Int -> Maybe String) -> Int -> String inspect :: Monad m => ModuleLocation -> ExceptT String m Inspection -> ExceptT String m Module -> ExceptT String m InspectedModule type ReadM a = StateT String [] a -- | Parse readable value readParse :: Read a => ReadM a -- | Run parser parseReads :: String -> ReadM a -> [a] -- | Run parser and select first result parseRead :: String -> ReadM a -> Maybe a module HsDev.Tools.Cabal data CabalPackage CabalPackage :: String -> Maybe String -> Maybe Version -> [Version] -> Maybe String -> Maybe License -> CabalPackage [cabalPackageName] :: CabalPackage -> String [cabalPackageSynopsis] :: CabalPackage -> Maybe String [cabalPackageDefaultVersion] :: CabalPackage -> Maybe Version [cabalPackageInstalledVersions] :: CabalPackage -> [Version] [cabalPackageHomepage] :: CabalPackage -> Maybe String [cabalPackageLicense] :: CabalPackage -> Maybe License cabalList :: [String] -> ToolM [CabalPackage] -- | A Version represents the version of a software entity. -- -- An instance of Eq is provided, which implements exact equality -- modulo reordering of the tags in the versionTags field. -- -- An instance of Ord is also provided, which gives lexicographic -- ordering on the versionBranch fields (i.e. 2.1 > 2.0, 1.2.3 -- > 1.2.2, etc.). This is expected to be sufficient for many uses, -- but note that you may need to use a more specific ordering for your -- versioning scheme. For example, some versioning schemes may include -- pre-releases which have tags "pre1", "pre2", and so -- on, and these would need to be taken into account when determining -- ordering. In some cases, date ordering may be more appropriate, so the -- application would have to look for date tags in the -- versionTags field and compare those. The bottom line is, don't -- always assume that compare and other Ord operations are -- the right thing for every Version. -- -- Similarly, concrete representations of versions may differ. One -- possible concrete representation is provided (see showVersion -- and parseVersion), but depending on the application a different -- concrete representation may be more appropriate. data Version :: * Version :: [Int] -> [String] -> Version -- | The numeric branch for this version. This reflects the fact that most -- software versions are tree-structured; there is a main trunk which is -- tagged with versions at various points (1,2,3...), and the first -- branch off the trunk after version 3 is 3.1, the second branch off the -- trunk after version 3 is 3.2, and so on. The tree can be branched -- arbitrarily, just by adding more digits. -- -- We represent the branch as a list of Int, so version 3.2.1 -- becomes [3,2,1]. Lexicographic ordering (i.e. the default instance of -- Ord for [Int]) gives the natural ordering of branches. [versionBranch] :: Version -> [Int] -- | A version can be tagged with an arbitrary list of strings. The -- interpretation of the list of tags is entirely dependent on the entity -- that this version applies to. [versionTags] :: Version -> [String] -- | Indicates the license under which a package's source code is released. -- Versions of the licenses not listed here will be rejected by Hackage -- and cause cabal check to issue a warning. data License :: * -- | GNU General Public License, version 2 or version 3. GPL :: Maybe Version -> License -- | GNU Affero General Public License, version 3. AGPL :: Maybe Version -> License -- | GNU Lesser General Public License, version 2.1 or version -- 3. LGPL :: Maybe Version -> License -- | 2-clause BSD license. BSD2 :: License -- | 3-clause BSD license. BSD3 :: License -- | 4-clause BSD license. This license has not been approved by the -- OSI and is incompatible with the GNU GPL. It is provided for -- historical reasons and should be avoided. BSD4 :: License -- | MIT license. MIT :: License -- | ISC license ISC :: License -- | Mozilla Public License, version 2.0. MPL :: Version -> License -- | Apache License, version 2.0. Apache :: Maybe Version -> License -- | The author of a package disclaims any copyright to its source code and -- dedicates it to the public domain. This is not a software license. -- Please note that it is not possible to dedicate works to the public -- domain in every jurisdiction, nor is a work that is in the public -- domain in one jurisdiction necessarily in the public domain elsewhere. PublicDomain :: License -- | Explicitly 'All Rights Reserved', eg for proprietary software. The -- package may not be legally modified or redistributed by anyone but the -- rightsholder. AllRightsReserved :: License -- | No license specified which legally defaults to 'All Rights Reserved'. -- The package may not be legally modified or redistributed by anyone but -- the rightsholder. UnspecifiedLicense :: License -- | Any other software license. OtherLicense :: License -- | Indicates an erroneous license name. UnknownLicense :: String -> License instance GHC.Show.Show HsDev.Tools.Cabal.CabalPackage instance GHC.Read.Read HsDev.Tools.Cabal.CabalPackage instance GHC.Classes.Eq HsDev.Tools.Cabal.CabalPackage instance Data.Aeson.Types.Class.ToJSON HsDev.Tools.Cabal.CabalPackage instance Data.Aeson.Types.Class.FromJSON HsDev.Tools.Cabal.CabalPackage module HsDev.Tools.Hayoo -- | Hayoo response data HayooResult HayooResult :: Int -> Int -> Int -> [HayooSymbol] -> HayooResult [resultMax] :: HayooResult -> Int [resultOffset] :: HayooResult -> Int [resultCount] :: HayooResult -> Int [resultResult] :: HayooResult -> [HayooSymbol] -- | Hayoo symbol data HayooSymbol HayooSymbol :: String -> String -> String -> String -> String -> String -> String -> [String] -> Double -> String -> HayooSymbol [resultUri] :: HayooSymbol -> String [tag] :: HayooSymbol -> String [hayooPackage] :: HayooSymbol -> String [hayooName] :: HayooSymbol -> String [hayooSource] :: HayooSymbol -> String [hayooDescription] :: HayooSymbol -> String [hayooSignature] :: HayooSymbol -> String [hayooModules] :: HayooSymbol -> [String] [hayooScore] :: HayooSymbol -> Double [hayooType] :: HayooSymbol -> String -- | HayooFunction as Declaration hayooAsDeclaration :: HayooSymbol -> Maybe ModuleDeclaration -- | Search hayoo hayoo :: String -> Maybe Int -> ExceptT String IO HayooResult -- | Remove tags in description untagDescription :: String -> String instance GHC.Show.Show HsDev.Tools.Hayoo.HayooResult instance GHC.Read.Read HsDev.Tools.Hayoo.HayooResult instance GHC.Classes.Ord HsDev.Tools.Hayoo.HayooResult instance GHC.Classes.Eq HsDev.Tools.Hayoo.HayooResult instance GHC.Show.Show HsDev.Tools.Hayoo.HayooSymbol instance GHC.Read.Read HsDev.Tools.Hayoo.HayooSymbol instance GHC.Classes.Ord HsDev.Tools.Hayoo.HayooSymbol instance GHC.Classes.Eq HsDev.Tools.Hayoo.HayooSymbol instance Data.Aeson.Types.Class.FromJSON HsDev.Tools.Hayoo.HayooResult instance HsDev.Symbols.Class.Symbol HsDev.Tools.Hayoo.HayooSymbol instance HsDev.Symbols.Documented.Documented HsDev.Tools.Hayoo.HayooSymbol instance Data.Aeson.Types.Class.FromJSON HsDev.Tools.Hayoo.HayooSymbol instance Data.Aeson.Types.Class.FromJSON HsDev.Tools.Hayoo.HayooValue module HsDev.Tools.HLint hlint :: FilePath -> Maybe String -> ExceptT String IO [Note OutputMessage] hlintFile :: FilePath -> ExceptT String IO [Note OutputMessage] hlintSource :: FilePath -> String -> ExceptT String IO [Note OutputMessage] instance GHC.Classes.Ord HsDev.Tools.HLint.Indent instance GHC.Classes.Eq HsDev.Tools.HLint.Indent instance GHC.Show.Show HsDev.Tools.HLint.Indent module HsDev.Tools.AutoFix data Correction Correction :: String -> Replace String -> Correction [_correctionMessage] :: Correction -> String [_corrector] :: Correction -> Replace String correctionMessage :: Lens' Correction String corrector :: Lens' Correction (Replace String) correct :: Correction -> Edit String corrections :: [Note OutputMessage] -> [Note Correction] -- | Apply corrections autoFix :: ApplyMap r => [Correction] -> EditM String r () type CorrectorMatch = Note OutputMessage -> Maybe (Note Correction) correctors :: [CorrectorMatch] match :: String -> ((Int -> Maybe String) -> Region -> Correction) -> CorrectorMatch findCorrector :: Note OutputMessage -> Maybe (Note Correction) instance GHC.Show.Show HsDev.Tools.AutoFix.Correction instance GHC.Classes.Eq HsDev.Tools.AutoFix.Correction instance Data.Aeson.Types.Class.ToJSON HsDev.Tools.AutoFix.Correction instance Data.Aeson.Types.Class.FromJSON HsDev.Tools.AutoFix.Correction instance Data.Text.Region.ApplyMap HsDev.Tools.AutoFix.Correction instance Data.Text.Region.ApplyMap a => Data.Text.Region.ApplyMap (HsDev.Tools.Types.Note a) module HsDev.Watcher -- | Watch for project sources changes watchProject :: Watcher -> Project -> [String] -> IO () -- | Watch for standalone source watchModule :: Watcher -> ModuleLocation -> IO () -- | Watch for sandbox watchSandbox :: Watcher -> Cabal -> [String] -> IO () isSource :: Event -> Bool isCabal :: Event -> Bool isConf :: Event -> Bool module HsDev.Tools.HDocs -- | Get docs for modules hdocsy :: [ModuleLocation] -> [String] -> IO [Map String String] -- | Get docs for module hdocs :: ModuleLocation -> [String] -> IO (Map String String) -- | Get all docs hdocsCabal :: Cabal -> [String] -> ExceptT String IO (Map String (Map String String)) -- | Set docs for module setDocs :: Map String String -> Module -> Module -- | Load docs for module loadDocs :: [String] -> Module -> IO Module hdocsProcess :: String -> [String] -> IO (Maybe (Map String String)) module HsDev.Scan.Browse -- | Browse packages browsePackages :: [String] -> Cabal -> ExceptT String IO [ModulePackage] listModules :: [String] -> Cabal -> ExceptT String IO [ModuleLocation] browseModules :: [String] -> Cabal -> [ModuleLocation] -> ExceptT String IO [InspectedModule] -- | Browse all modules browse :: [String] -> Cabal -> ExceptT String IO [InspectedModule] withPackages :: [String] -> (DynFlags -> ExceptT String Ghc a) -> ExceptT String IO a withPackages_ :: [String] -> ExceptT String Ghc a -> ExceptT String IO a packageDbModules :: GhcMonad m => m [(PackageConfig, Module)] lookupModule_ :: DynFlags -> ModuleName -> [Module] module HsDev.Inspect -- | Analize source contents analyzeModule :: [String] -> Maybe FilePath -> String -> Either String Module -- | Extract files docs and set them to declarations inspectDocsChunk :: [String] -> [Module] -> ExceptT String IO [Module] -- | Extract file docs and set them to module declarations inspectDocs :: [String] -> Module -> ExceptT String IO Module -- | Like inspectDocs, but in Ghc monad inspectDocsGhc :: [String] -> Module -> ExceptT String Ghc Module -- | Inspect contents inspectContents :: String -> [(String, String)] -> [String] -> String -> ExceptT String IO InspectedModule contentsInspection :: String -> [String] -> ExceptT String IO Inspection -- | Inspect file inspectFile :: [(String, String)] -> [String] -> FilePath -> Maybe String -> ExceptT String IO InspectedModule -- | File inspection data fileInspection :: FilePath -> [String] -> ExceptT String IO Inspection -- | Enumerate project dirs projectDirs :: Project -> ExceptT String IO [Extensions FilePath] -- | Enumerate project source files projectSources :: Project -> ExceptT String IO [Extensions FilePath] -- | Inspect project inspectProject :: [(String, String)] -> [String] -> Project -> ExceptT String IO (Project, [InspectedModule]) -- | Get actual defines getDefines :: IO [(String, String)] preprocess :: [(String, String)] -> FilePath -> String -> ExceptT String IO String preprocess_ :: [(String, String)] -> [String] -> FilePath -> String -> IO String module Data.Maybe.JustIf -- | Return Just if True justIf :: a -> Bool -> Maybe a -- | Return Just if f x = True justWhen :: a -> (a -> Bool) -> Maybe a -- | Flipped version of justIf soJust :: Bool -> a -> Maybe a module Data.Lisp data Lisp Null :: Lisp Bool :: Bool -> Lisp Symbol :: String -> Lisp String :: String -> Lisp Number :: Scientific -> Lisp List :: [Lisp] -> Lisp lisp :: Int -> ReadP Lisp encodeLisp :: ToJSON a => a -> ByteString decodeLisp :: FromJSON a => ByteString -> Either String a instance GHC.Classes.Eq Data.Lisp.Lisp instance GHC.Read.Read Data.Lisp.Lisp instance GHC.Show.Show Data.Lisp.Lisp instance Data.Aeson.Types.Class.ToJSON Data.Lisp.Lisp instance Data.Aeson.Types.Class.FromJSON Data.Lisp.Lisp module Data.Help class Help a brief :: Help a => a -> String help :: Help a => a -> [String] indent :: String -> String indentHelp :: [String] -> [String] detailed :: Help a => a -> [String] indented :: Help a => a -> [String] module Control.Concurrent.Util fork :: (MonadIO m, Functor m) => IO () -> m () race :: [IO a] -> IO a timeout :: Int -> IO a -> IO (Maybe a) withSync :: a -> ((a -> IO ()) -> IO b) -> IO a withSync_ :: (IO () -> IO a) -> IO () module Control.Concurrent.FiniteChan -- | Chan is stoppable channel unline Chan data Chan a -- | Create channel newChan :: IO (Chan a) -- | Duplicate channel dupChan :: Chan a -> IO (Chan a) -- | Write data to channel putChan :: Chan a -> a -> IO () -- | Get data from channel getChan :: Chan a -> IO (Maybe a) -- | Read channel contents readChan :: Chan a -> IO [a] -- | Close channel. putChan will still work, but no data will be -- available on other ending closeChan :: Chan a -> IO () -- | Stop channel and return all data stopChan :: Chan a -> IO [a] module Control.Concurrent.Worker data Worker m Worker :: Chan (Async (), m ()) -> (forall a. m a -> m a) -> MVar (Async ()) -> IO Bool -> Worker m [workerChan] :: Worker m -> Chan (Async (), m ()) [workerWrap] :: Worker m -> forall a. m a -> m a [workerTask] :: Worker m -> MVar (Async ()) [workerRestart] :: Worker m -> IO Bool -- | Create new worker startWorker :: MonadIO m => (m () -> IO ()) -> (m () -> m ()) -> (forall a. m a -> m a) -> IO (Worker m) sendTask :: (MonadCatch m, MonadIO m) => Worker m -> m a -> IO (Async a) pushTask :: (MonadCatch m, MonadIO m) => Worker m -> m a -> IO (Async a) stopWorker :: Worker m -> IO () -- | Send empty task and wait until worker run it syncTask :: (MonadCatch m, MonadIO m) => Worker m -> IO () -- | Run action in worker and wait for result inWorkerWith :: (MonadIO m, MonadCatch m, MonadIO n) => (SomeException -> n a) -> Worker m -> m a -> n a -- | Run action in worker and wait for result inWorker :: (MonadIO m, MonadCatch m) => Worker m -> m a -> IO a -- | Run action in worker and wait for result inWorker_ :: (MonadIO m, MonadCatch m) => Worker m -> m a -> ExceptT SomeException IO a module HsDev.Tools.GhcMod list :: [String] -> Cabal -> ExceptT String IO [ModuleLocation] browse :: [String] -> Cabal -> String -> Maybe ModulePackage -> ExceptT String IO InspectedModule browseInspection :: [String] -> Inspection langs :: ExceptT String IO [String] flags :: ExceptT String IO [String] info :: [String] -> Cabal -> FilePath -> String -> GhcModT IO Declaration data TypedRegion TypedRegion :: Region -> String -> String -> TypedRegion [typedRegion] :: TypedRegion -> Region [typedExpr] :: TypedRegion -> String [typedType] :: TypedRegion -> String typeOf :: [String] -> Cabal -> FilePath -> Int -> Int -> GhcModT IO [TypedRegion] -- | Output message from some tool (ghc, ghc-mod, hlint) with optional -- suggestion data OutputMessage OutputMessage :: String -> Maybe String -> OutputMessage [_message] :: OutputMessage -> String [_messageSuggestion] :: OutputMessage -> Maybe String parseOutputMessages :: String -> [Note OutputMessage] parseOutputMessage :: String -> Maybe (Note OutputMessage) check :: [String] -> Cabal -> [FilePath] -> Maybe Project -> GhcModT IO [Note OutputMessage] lint :: [String] -> FilePath -> GhcModT IO [Note OutputMessage] runGhcMod :: (IOish m, MonadCatch m) => Options -> GhcModT m a -> ExceptT String m a locateGhcModEnv :: FilePath -> IO (Either Project Cabal) ghcModEnvPath :: FilePath -> Either Project Cabal -> FilePath -- | Create ghc-mod worker for project or for sandbox ghcModWorker :: Either Project Cabal -> IO (Worker (GhcModT IO)) type WorkerMap = MVar (Map FilePath (Worker (GhcModT IO))) -- | Manage many ghc-mod workers for each project/sandbox ghcModMultiWorker :: IO (Worker (ReaderT WorkerMap IO)) dispatch :: FilePath -> GhcModT IO a -> ReaderT WorkerMap IO (Async a) waitMultiGhcMod :: Worker (ReaderT WorkerMap IO) -> FilePath -> GhcModT IO a -> ExceptT String IO a type GhcModT (m :: * -> *) = GmT (GmOutT m) instance GHC.Show.Show HsDev.Tools.GhcMod.TypedRegion instance GHC.Read.Read HsDev.Tools.GhcMod.TypedRegion instance GHC.Classes.Ord HsDev.Tools.GhcMod.TypedRegion instance GHC.Classes.Eq HsDev.Tools.GhcMod.TypedRegion instance Control.DeepSeq.NFData HsDev.Tools.GhcMod.TypedRegion instance Data.Aeson.Types.Class.ToJSON HsDev.Tools.GhcMod.TypedRegion instance Data.Aeson.Types.Class.FromJSON HsDev.Tools.GhcMod.TypedRegion instance Control.Monad.Catch.MonadThrow (Language.Haskell.GhcMod.Monad.Types.GmOutT GHC.Types.IO) instance Control.Monad.Catch.MonadCatch (Language.Haskell.GhcMod.Monad.Types.GmOutT GHC.Types.IO) instance Control.Monad.Catch.MonadThrow (Language.Haskell.GhcMod.Monad.Types.GhcModT GHC.Types.IO) instance Control.Monad.Catch.MonadCatch (Language.Haskell.GhcMod.Monad.Types.GhcModT GHC.Types.IO) module HsDev.Tools.GhcMod.InferType -- | Is declaration untyped untyped :: DeclarationInfo -> Bool -- | Infer type of declaration inferType :: [String] -> Cabal -> FilePath -> Declaration -> GhcModT IO Declaration -- | Infer types for module inferTypes :: [String] -> Cabal -> Module -> GhcModT IO Module type GhcModT (m :: * -> *) = GmT (GmOutT m) -- | Infer type in module infer :: [String] -> Cabal -> Module -> ExceptT String IO Module module HsDev.Tools.Ghc.Worker -- | Ghc worker. Pass options and initializer action ghcWorker :: [String] -> Ghc () -> IO (Worker Ghc) -- | Interpreter worker is worker with preludeModules loaded ghciWorker :: IO (Worker Ghc) -- | Alter DynFlags temporary withFlags :: Ghc a -> Ghc a -- | Update DynFlags modifyFlags :: (DynFlags -> DynFlags) -> Ghc () addCmdOpts :: [String] -> Ghc DynFlags -- | Import some modules importModules :: [String] -> Ghc () -- | Default interpreter modules preludeModules :: [String] -- | Evaluate expression evaluate :: String -> Ghc String -- | Clear loaded targets clearTargets :: Ghc () -- | Make target with its source code optional makeTarget :: String -> Maybe String -> Ghc Target -- | Load all targets loadTargets :: [Target] -> Ghc () -- | Get list of installed packages listPackages :: Ghc [ModulePackage] -- | Get region of SrcSpan spanRegion :: SrcSpan -> Region -- | Set current directory and restore it after action withCurrentDirectory :: FilePath -> Ghc a -> Ghc a -- | A minimal implementation of a GhcMonad. If you need a custom -- monad, e.g., to maintain additional state consider wrapping this monad -- or using GhcT. data Ghc a :: * -> * instance Control.Monad.Catch.MonadThrow GhcMonad.Ghc instance Control.Monad.Catch.MonadCatch GhcMonad.Ghc module HsDev.Tools.Ghc.Types data TypedExpr TypedExpr :: String -> String -> TypedExpr [_typedExpr] :: TypedExpr -> String [_typedType] :: TypedExpr -> String typedExpr :: Lens' TypedExpr String typedType :: Lens' TypedExpr String moduleTypes :: GhcMonad m => FilePath -> m [(SrcSpan, Type)] fileTypes :: [String] -> Cabal -> Module -> Maybe String -> ExceptT String Ghc [Note TypedExpr] instance Control.DeepSeq.NFData HsDev.Tools.Ghc.Types.TypedExpr instance Data.Aeson.Types.Class.ToJSON HsDev.Tools.Ghc.Types.TypedExpr instance Data.Aeson.Types.Class.FromJSON HsDev.Tools.Ghc.Types.TypedExpr instance GHC.Show.Show HsDev.Tools.Ghc.Types.TypedExpr instance GHC.Read.Read HsDev.Tools.Ghc.Types.TypedExpr instance GHC.Classes.Ord HsDev.Tools.Ghc.Types.TypedExpr instance GHC.Classes.Eq HsDev.Tools.Ghc.Types.TypedExpr instance HsDev.Tools.Ghc.Types.HasType (HsExpr.LHsExpr Var.Id) instance HsDev.Tools.Ghc.Types.HasType (HsBinds.LHsBind Var.Id) instance HsDev.Tools.Ghc.Types.HasType (HsPat.LPat Var.Id) module HsDev.Tools.Ghc.Check -- | Check files and collect warnings and errors checkFiles :: [String] -> Cabal -> [FilePath] -> Maybe Project -> Ghc [Note OutputMessage] -- | Check module source check :: [String] -> Cabal -> Module -> Maybe String -> ExceptT String Ghc [Note OutputMessage] -- | Check module and collect warnings and errors checkFile :: [String] -> Cabal -> Module -> ExceptT String Ghc [Note OutputMessage] -- | Check module and collect warnings and errors checkSource :: [String] -> Cabal -> Module -> String -> ExceptT String Ghc [Note OutputMessage] -- | A minimal implementation of a GhcMonad. If you need a custom -- monad, e.g., to maintain additional state consider wrapping this monad -- or using GhcT. data Ghc a :: * -> * -- | Cabal or sandbox data Cabal Cabal :: Cabal Sandbox :: FilePath -> Cabal -- | Cabal project data Project Project :: String -> FilePath -> FilePath -> Maybe ProjectDescription -> Project [_projectName] :: Project -> String [_projectPath] :: Project -> FilePath [_projectCabal] :: Project -> FilePath [_projectDescription] :: Project -> Maybe ProjectDescription module Control.Apply.Util (&) :: a -> (a -> b) -> b chain :: [a -> a] -> a -> a -- | Flipped version of chain, which can be used like this: -- ---- foo `with` [f, g, h] --with :: a -> [a -> a] -> a module Data.Group -- | Group is monoid with invertibility But for our purposes we prefer two -- functions: add and sub. class Eq a => Group a add :: Group a => a -> a -> a sub :: Group a => a -> a -> a zero :: Group a => a -- | Sums list groupSum :: Group a => [a] -> a instance GHC.Classes.Eq a => Data.Group.Group [a] instance GHC.Classes.Ord a => Data.Group.Group (Data.Set.Base.Set a) instance (GHC.Classes.Ord k, Data.Group.Group a) => Data.Group.Group (Data.Map.Base.Map k a) module Data.Async -- | Event on async value data Event a Append :: a -> Event a Remove :: a -> Event a Clear :: Event a Modify :: (a -> a) -> Event a Action :: (a -> IO a) -> Event a -- | Event to function event :: Group a => Event a -> a -> IO a data Async a Async :: MVar a -> Chan (Event a) -> Async a [asyncVar] :: Async a -> MVar a [asyncEvents] :: Async a -> Chan (Event a) newAsync :: (NFData a, Group a) => IO (Async a) readAsync :: Async a -> IO a modifyAsync :: Async a -> Event a -> IO () -- | Group is monoid with invertibility But for our purposes we prefer two -- functions: add and sub. class Eq a => Group a -- | A class of types that can be fully evaluated. -- -- Since: 1.1.0.0 class NFData a module HsDev.Database -- | HsDev database data Database Database :: [InspectedModule] -> [Project] -> Database [databaseModules] :: Database -> [InspectedModule] [databaseProjects] :: Database -> [Project] -- | Database intersection, prefers first database data databaseIntersection :: Database -> Database -> Database -- | Check if database is empty nullDatabase :: Database -> Bool -- | Bring all locals to scope databaseLocals :: Database -> Database -- | All modules allModules :: Database -> [Module] -- | All declarations allDeclarations :: Database -> [ModuleDeclaration] -- | All packages allPackages :: Database -> [ModulePackage] -- | Make database from module fromModule :: InspectedModule -> Database -- | Make database from project fromProject :: Project -> Database -- | Filter database by predicate filterDB :: (ModuleId -> Bool) -> (Project -> Bool) -> Database -> Database -- | Project database projectDB :: Project -> Database -> Database -- | Cabal database cabalDB :: Cabal -> Database -> Database -- | Standalone database standaloneDB :: Database -> Database -- | Select module by predicate selectModules :: (Module -> Bool) -> Database -> [Module] -- | Select declaration by predicate selectDeclarations :: (ModuleDeclaration -> Bool) -> Database -> [ModuleDeclaration] -- | Lookup module by its location and name lookupModule :: ModuleLocation -> Database -> Maybe Module -- | Lookup inspected module lookupInspected :: ModuleLocation -> Database -> Maybe InspectedModule -- | Lookup module by its source file lookupFile :: FilePath -> Database -> Maybe Module -- | Refine project refineProject :: Database -> Project -> Maybe Project -- | Get inspected module getInspected :: Database -> Module -> InspectedModule -- | Append database append :: Database -> Database -> Database -- | Remove database remove :: Database -> Database -> Database -- | Structured database data Structured Structured :: Map Cabal Database -> Map FilePath Database -> Database -> Structured [structuredCabals] :: Structured -> Map Cabal Database [structuredProjects] :: Structured -> Map FilePath Database [structuredFiles] :: Structured -> Database structured :: [Database] -> [Database] -> Database -> Either String Structured structurize :: Database -> Structured merge :: Structured -> Database -- | A Map from keys k to values a. data Map k a :: * -> * -> * instance GHC.Classes.Ord HsDev.Database.Structured instance GHC.Classes.Eq HsDev.Database.Structured instance GHC.Classes.Ord HsDev.Database.Database instance GHC.Classes.Eq HsDev.Database.Database instance Control.DeepSeq.NFData HsDev.Database.Database instance Data.Group.Group HsDev.Database.Database instance GHC.Base.Monoid HsDev.Database.Database instance Data.Aeson.Types.Class.ToJSON HsDev.Database.Database instance Data.Aeson.Types.Class.FromJSON HsDev.Database.Database instance Control.DeepSeq.NFData HsDev.Database.Structured instance Data.Group.Group HsDev.Database.Structured instance GHC.Base.Monoid HsDev.Database.Structured instance Data.Aeson.Types.Class.ToJSON HsDev.Database.Structured instance Data.Aeson.Types.Class.FromJSON HsDev.Database.Structured module HsDev.Cache -- | Escape path escapePath :: FilePath -> FilePath -- | Name of cache for cabal cabalCache :: Cabal -> FilePath -- | Name of cache for projects projectCache :: Project -> FilePath -- | Name of cache for standalone files standaloneCache :: FilePath -- | Dump database to file dump :: FilePath -> Database -> IO () -- | Load database from file, strict load :: FilePath -> IO (Either String Database) -- | HsDev database data Database module HsDev.Scan -- | Enum cabal modules enumCabal :: [String] -> Cabal -> ExceptT String IO [ModuleLocation] -- | Compile flags type CompileFlag = String -- | Module with flags ready to scan type ModuleToScan = (ModuleLocation, [CompileFlag], Maybe String) -- | Project ready to scan type ProjectToScan = (Project, [ModuleToScan]) -- | Cabal sandbox to scan type SandboxToScan = Cabal -- | Scan info data ScanContents ScanContents :: [ModuleToScan] -> [ProjectToScan] -> [SandboxToScan] -> ScanContents [modulesToScan] :: ScanContents -> [ModuleToScan] [projectsToScan] :: ScanContents -> [ProjectToScan] [sandboxesToScan] :: ScanContents -> [SandboxToScan] -- | Enum project sources enumProject :: Project -> ExceptT String IO ProjectToScan -- | Enum directory modules enumDirectory :: FilePath -> ExceptT String IO ScanContents -- | Scan project file scanProjectFile :: [String] -> FilePath -> ExceptT String IO Project -- | Scan module scanModule :: [(String, String)] -> [String] -> ModuleLocation -> Maybe String -> ExceptT String IO InspectedModule -- | Scan additional info and modify scanned module. Dones't fail on error, -- just left module unchanged scanModify :: ([String] -> Cabal -> Module -> ExceptT String IO Module) -> InspectedModule -> ExceptT String IO InspectedModule -- | Is inspected module up to date? upToDate :: [String] -> InspectedModule -> ExceptT String IO Bool -- | Rescan inspected module rescanModule :: [(String, String)] -> [String] -> InspectedModule -> ExceptT String IO (Maybe InspectedModule) -- | Is module new or recently changed changedModule :: Database -> [String] -> ModuleLocation -> ExceptT String IO Bool -- | Returns new (to scan) and changed (to rescan) modules changedModules :: Database -> [String] -> [ModuleToScan] -> ExceptT String IO [ModuleToScan] instance Control.DeepSeq.NFData HsDev.Scan.ScanContents module HsDev.Database.Async update :: MonadIO m => Async Database -> m Database -> m () clear :: MonadIO m => Async Database -> m Database -> m () -- | This function is used to ensure that all previous updates were applied wait :: MonadIO m => Async Database -> m () module HsDev.Server.Types data CommandOptions CommandOptions :: Async Database -> (Database -> IO ()) -> ((FilePath -> ExceptT String IO Structured) -> IO (Maybe Database)) -> FilePath -> (Level -> String -> IO ()) -> Log -> (([String] -> IO ()) -> IO ()) -> IO () -> Watcher -> Worker Ghc -> Worker Ghc -> Worker (ReaderT WorkerMap IO) -> (Notification -> IO ()) -> IO () -> IO () -> IO () -> [(String, String)] -> CommandOptions [commandDatabase] :: CommandOptions -> Async Database [commandWriteCache] :: CommandOptions -> Database -> IO () [commandReadCache] :: CommandOptions -> (FilePath -> ExceptT String IO Structured) -> IO (Maybe Database) [commandRoot] :: CommandOptions -> FilePath [commandLog] :: CommandOptions -> Level -> String -> IO () [commandLogger] :: CommandOptions -> Log [commandListenLog] :: CommandOptions -> ([String] -> IO ()) -> IO () [commandLogWait] :: CommandOptions -> IO () [commandWatcher] :: CommandOptions -> Watcher [commandGhc] :: CommandOptions -> Worker Ghc [commandGhci] :: CommandOptions -> Worker Ghc [commandGhcMod] :: CommandOptions -> Worker (ReaderT WorkerMap IO) [commandNotify] :: CommandOptions -> Notification -> IO () [commandLink] :: CommandOptions -> IO () [commandHold] :: CommandOptions -> IO () [commandExit] :: CommandOptions -> IO () [commandDefines] :: CommandOptions -> [(String, String)] data CommandError CommandError :: String -> [Pair] -> CommandError commandError_ :: String -> ExceptT CommandError IO a commandError :: String -> [Pair] -> ExceptT CommandError IO a type CommandM a = ExceptT CommandError IO a -- | Server control command data ServerCommand Version :: ServerCommand Start :: ServerOpts -> ServerCommand Run :: ServerOpts -> ServerCommand Stop :: ClientOpts -> ServerCommand Connect :: ClientOpts -> ServerCommand Remote :: ClientOpts -> Bool -> Command -> ServerCommand -- | Server options data ServerOpts ServerOpts :: Int -> Int -> Maybe FilePath -> String -> Maybe FilePath -> Bool -> ServerOpts [serverPort] :: ServerOpts -> Int [serverTimeout] :: ServerOpts -> Int [serverLog] :: ServerOpts -> Maybe FilePath [serverLogConfig] :: ServerOpts -> String [serverCache] :: ServerOpts -> Maybe FilePath [serverLoad] :: ServerOpts -> Bool -- | Client options data ClientOpts ClientOpts :: Int -> Bool -> Bool -> Int -> Bool -> ClientOpts [clientPort] :: ClientOpts -> Int [clientPretty] :: ClientOpts -> Bool [clientStdin] :: ClientOpts -> Bool [clientTimeout] :: ClientOpts -> Int [clientSilent] :: ClientOpts -> Bool serverOptsArgs :: ServerOpts -> [String] data Request Request :: Command -> FilePath -> Bool -> Int -> Bool -> Request [requestCommand] :: Request -> Command [requestDirectory] :: Request -> FilePath [requestNoFile] :: Request -> Bool [requestTimeout] :: Request -> Int [requestSilent] :: Request -> Bool -- | Command from client data Command Ping :: Command Listen :: Command AddData :: [AddedContents] -> Command [addedContents] :: Command -> [AddedContents] Scan :: [FilePath] -> [Cabal] -> [FilePath] -> [FilePath] -> [FileContents] -> [String] -> Bool -> Bool -> Command [scanProjects] :: Command -> [FilePath] [scanSandboxes] :: Command -> [Cabal] [scanFiles] :: Command -> [FilePath] [scanPaths] :: Command -> [FilePath] [scanContents] :: Command -> [FileContents] [scanGhcOpts] :: Command -> [String] [scanDocs] :: Command -> Bool [scanInferTypes] :: Command -> Bool RefineDocs :: [FilePath] -> [FilePath] -> [String] -> Command [docsProjects] :: Command -> [FilePath] [docsFiles] :: Command -> [FilePath] [docsModules] :: Command -> [String] InferTypes :: [FilePath] -> [FilePath] -> [String] -> Command [inferProjects] :: Command -> [FilePath] [inferFiles] :: Command -> [FilePath] [inferModules] :: Command -> [String] Remove :: [FilePath] -> [String] -> [Cabal] -> [FilePath] -> Command [removeProjects] :: Command -> [FilePath] [removePackages] :: Command -> [String] [removeSandboxes] :: Command -> [Cabal] [removeFiles] :: Command -> [FilePath] InfoModules :: TargetFilter -> Command InfoPackages :: Command InfoProjects :: Command InfoSandboxes :: Command InfoSymbol :: SearchQuery -> TargetFilter -> Command InfoModule :: SearchQuery -> TargetFilter -> Command InfoResolve :: FilePath -> Bool -> Command InfoProject :: (Either String FilePath) -> Command InfoSandbox :: FilePath -> Command Lookup :: String -> FilePath -> Command Whois :: String -> FilePath -> Command ResolveScopeModules :: FilePath -> Command ResolveScope :: SearchQuery -> Bool -> FilePath -> Command Complete :: String -> Bool -> FilePath -> Command Hayoo :: String -> Int -> Int -> Command [hayooQuery] :: Command -> String [hayooPage] :: Command -> Int [hayooPages] :: Command -> Int CabalList :: [String] -> Command [cabalListPackages] :: Command -> [String] Lint :: [FilePath] -> [FileContents] -> Command [lintFiles] :: Command -> [FilePath] [lintContents] :: Command -> [FileContents] Check :: [FilePath] -> [FileContents] -> [String] -> Command [checkFiles] :: Command -> [FilePath] [checkContents] :: Command -> [FileContents] [checkGhcOpts] :: Command -> [String] CheckLint :: [FilePath] -> [FileContents] -> [String] -> Command [checkLintFiles] :: Command -> [FilePath] [checkLintContents] :: Command -> [FileContents] [checkLintGhcOpts] :: Command -> [String] Types :: [FilePath] -> [FileContents] -> [String] -> Command [typesFiles] :: Command -> [FilePath] [typesContents] :: Command -> [FileContents] [typesGhcOpts] :: Command -> [String] GhcMod :: GhcModCommand -> Command [ghcModCommand] :: Command -> GhcModCommand AutoFix :: AutoFixCommand -> Command [autoFixCommand] :: Command -> AutoFixCommand GhcEval :: [String] -> Command [ghcEvalExpressions] :: Command -> [String] Link :: Bool -> Command [linkHold] :: Command -> Bool Exit :: Command data AddedContents AddedDatabase :: Database -> AddedContents AddedModule :: InspectedModule -> AddedContents AddedProject :: Project -> AddedContents data GhcModCommand GhcModLang :: GhcModCommand GhcModFlags :: GhcModCommand GhcModType :: Position -> FilePath -> [String] -> GhcModCommand GhcModLint :: [FilePath] -> [String] -> GhcModCommand GhcModCheck :: [FilePath] -> [String] -> GhcModCommand GhcModCheckLint :: [FilePath] -> [String] -> [String] -> GhcModCommand data AutoFixCommand AutoFixShow :: [Note OutputMessage] -> AutoFixCommand AutoFixFix :: [Note Correction] -> [Note Correction] -> Bool -> AutoFixCommand data FileContents FileContents :: FilePath -> String -> FileContents data TargetFilter TargetProject :: String -> TargetFilter TargetFile :: FilePath -> TargetFilter TargetModule :: String -> TargetFilter TargetDepsOf :: String -> TargetFilter TargetCabal :: Cabal -> TargetFilter TargetPackage :: String -> TargetFilter TargetSourced :: TargetFilter TargetStandalone :: TargetFilter TargetAny :: TargetFilter data SearchQuery SearchQuery :: String -> SearchType -> SearchQuery data SearchType SearchExact :: SearchType SearchPrefix :: SearchType SearchInfix :: SearchType SearchSuffix :: SearchType SearchRegex :: SearchType class FromCmd a cmdP :: FromCmd a => Parser a instance GHC.Show.Show HsDev.Server.Types.ServerCommand instance GHC.Show.Show HsDev.Server.Types.Command instance GHC.Show.Show HsDev.Server.Types.SearchQuery instance GHC.Show.Show HsDev.Server.Types.SearchType instance GHC.Show.Show HsDev.Server.Types.TargetFilter instance GHC.Classes.Eq HsDev.Server.Types.TargetFilter instance GHC.Show.Show HsDev.Server.Types.FileContents instance GHC.Show.Show HsDev.Server.Types.AutoFixCommand instance GHC.Show.Show HsDev.Server.Types.GhcModCommand instance GHC.Show.Show HsDev.Server.Types.ClientOpts instance GHC.Show.Show HsDev.Server.Types.ServerOpts instance GHC.Base.Monoid HsDev.Server.Types.CommandError instance Data.Default.Class.Default HsDev.Server.Types.ServerOpts instance Data.Default.Class.Default HsDev.Server.Types.ClientOpts instance HsDev.Util.FromCmd HsDev.Server.Types.ServerCommand instance HsDev.Util.FromCmd HsDev.Server.Types.ServerOpts instance HsDev.Util.FromCmd HsDev.Server.Types.ClientOpts instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Types.Request instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Types.Request instance GHC.Show.Show HsDev.Server.Types.AddedContents instance System.Directory.Paths.Paths HsDev.Server.Types.Command instance System.Directory.Paths.Paths HsDev.Server.Types.GhcModCommand instance System.Directory.Paths.Paths HsDev.Server.Types.FileContents instance System.Directory.Paths.Paths HsDev.Server.Types.TargetFilter instance HsDev.Util.FromCmd HsDev.Server.Types.Command instance HsDev.Util.FromCmd HsDev.Server.Types.GhcModCommand instance HsDev.Util.FromCmd HsDev.Server.Types.AutoFixCommand instance HsDev.Util.FromCmd HsDev.Server.Types.FileContents instance HsDev.Util.FromCmd HsDev.Server.Types.TargetFilter instance HsDev.Util.FromCmd HsDev.Server.Types.SearchQuery instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Types.Command instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Types.Command instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Types.AddedContents instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Types.AddedContents instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Types.GhcModCommand instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Types.GhcModCommand instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Types.AutoFixCommand instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Types.AutoFixCommand instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Types.FileContents instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Types.FileContents instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Types.TargetFilter instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Types.TargetFilter instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Types.SearchQuery instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Types.SearchQuery instance Data.Aeson.Types.Class.ToJSON HsDev.Server.Types.SearchType instance Data.Aeson.Types.Class.FromJSON HsDev.Server.Types.SearchType module HsDev.Symbols.Resolve -- | Resolve monad uses existing Database and -- ResolvedTree as state. newtype ResolveM a ResolveM :: ReaderT Database (State ResolvedTree) a -> ResolveM a [runResolveM] :: ResolveM a -> ReaderT Database (State ResolvedTree) a -- | Tree of resolved modules type ResolvedTree = Map ModuleId ResolvedModule -- | Module with declarations bringed to scope and with exported -- declarations data ResolvedModule ResolvedModule :: Module -> [Declaration] -> [Declaration] -> ResolvedModule [_resolvedModule] :: ResolvedModule -> Module [_resolvedScope] :: ResolvedModule -> [Declaration] [_resolvedExports] :: ResolvedModule -> [Declaration] resolvedModule :: Lens' ResolvedModule Module resolvedScope :: Lens' ResolvedModule [Declaration] resolvedExports :: Lens' ResolvedModule [Declaration] -- | Make Module with scope declarations scopeModule :: ResolvedModule -> Module -- | Make Module with exported only declarations exportsModule :: ResolvedModule -> Module -- | Get top-level scope resolvedTopScope :: ResolvedModule -> [Declaration] -- | Resolve modules, function is not IO, so all file names must be -- canonicalized resolve :: (Traversable t, Foldable t) => Database -> t Module -> t ResolvedModule -- | Resolve one module resolveOne :: Database -> Module -> ResolvedModule -- | Resolve module resolveModule :: Module -> ResolveM ResolvedModule exported :: Declaration -> Export -> Maybe Declaration -- | Bring declarations into scope resolveImport :: Module -> Import -> ResolveM [Declaration] -- | Merge imported declarations mergeImported :: [Declaration] -> [Declaration] instance Control.Monad.Reader.Class.MonadReader HsDev.Database.Database HsDev.Symbols.Resolve.ResolveM instance Control.Monad.State.Class.MonadState HsDev.Symbols.Resolve.ResolvedTree HsDev.Symbols.Resolve.ResolveM instance GHC.Base.Monad HsDev.Symbols.Resolve.ResolveM instance GHC.Base.Applicative HsDev.Symbols.Resolve.ResolveM instance GHC.Base.Functor HsDev.Symbols.Resolve.ResolveM module HsDev.Commands -- | Find declaration by name findDeclaration :: Database -> String -> ExceptT String IO [ModuleDeclaration] -- | Find module by name findModule :: Database -> String -> ExceptT String IO [Module] -- | Find module in file fileModule :: Database -> FilePath -> ExceptT String IO Module -- | Lookup visible within project symbol lookupSymbol :: Database -> Cabal -> FilePath -> String -> ExceptT String IO [ModuleDeclaration] -- | Whois symbol in scope whois :: Database -> Cabal -> FilePath -> String -> ExceptT String IO [ModuleDeclaration] -- | Accessible modules scopeModules :: Database -> Cabal -> FilePath -> ExceptT String IO [Module] -- | Symbols in scope scope :: Database -> Cabal -> FilePath -> Bool -> ExceptT String IO [ModuleDeclaration] -- | Completions completions :: Database -> Cabal -> FilePath -> String -> Bool -> ExceptT String IO [ModuleDeclaration] -- | Module completions moduleCompletions :: Database -> [Module] -> String -> ExceptT String IO [String] -- | Check module checkModule :: (ModuleId -> Bool) -> (ModuleDeclaration -> Bool) -- | Check declaration checkDeclaration :: (Declaration -> Bool) -> (ModuleDeclaration -> Bool) -- | Allow only selected cabal sandbox restrictCabal :: Cabal -> ModuleId -> Bool -- | Check whether module is visible from source file visibleFrom :: Maybe Project -> Module -> ModuleId -> Bool -- | Split identifier into module name and identifier itself splitIdentifier :: String -> (Maybe String, String) -- | Get context file and project fileCtx :: Database -> FilePath -> ExceptT String IO (FilePath, Module, Maybe Project) -- | Try get context file fileCtxMaybe :: Database -> FilePath -> ExceptT String IO (FilePath, Maybe Module, Maybe Project) module HsDev module HsDev.Database.Update.Types data Status StatusWorking :: Status StatusOk :: Status StatusError :: String -> Status data Progress Progress :: Int -> Int -> Progress [progressCurrent] :: Progress -> Int [progressTotal] :: Progress -> Int data Task Task :: String -> Status -> String -> String -> Maybe Progress -> Task [taskName] :: Task -> String [taskStatus] :: Task -> Status [taskSubjectType] :: Task -> String [taskSubjectName] :: Task -> String [taskProgress] :: Task -> Maybe Progress data Settings Settings :: Async Database -> ((FilePath -> ExceptT String IO Structured) -> IO (Maybe Database)) -> (Database -> IO ()) -> ([Task] -> IO ()) -> [String] -> Bool -> Bool -> Worker (ReaderT WorkerMap IO) -> Log -> Watcher -> [(String, String)] -> Settings [database] :: Settings -> Async Database [databaseCacheReader] :: Settings -> (FilePath -> ExceptT String IO Structured) -> IO (Maybe Database) [databaseCacheWriter] :: Settings -> Database -> IO () [onStatus] :: Settings -> [Task] -> IO () [ghcOptions] :: Settings -> [String] [updateDocs] :: Settings -> Bool [runInferTypes] :: Settings -> Bool [settingsGhcModWorker] :: Settings -> Worker (ReaderT WorkerMap IO) [settingsLogger] :: Settings -> Log [settingsWatcher] :: Settings -> Watcher [settingsDefines] :: Settings -> [(String, String)] settings :: CommandOptions -> [String] -> Bool -> Bool -> Settings newtype UpdateDB m a UpdateDB :: ReaderT Settings (WriterT [ModuleLocation] m) a -> UpdateDB m a [runUpdateDB] :: UpdateDB m a -> ReaderT Settings (WriterT [ModuleLocation] m) a instance GHC.Base.Monad m => Control.Monad.Writer.Class.MonadWriter [HsDev.Symbols.Location.ModuleLocation] (HsDev.Database.Update.Types.UpdateDB m) instance GHC.Base.Monad m => Control.Monad.Reader.Class.MonadReader HsDev.Database.Update.Types.Settings (HsDev.Database.Update.Types.UpdateDB m) instance GHC.Base.Functor m => GHC.Base.Functor (HsDev.Database.Update.Types.UpdateDB m) instance Control.Monad.Catch.MonadCatch m => Control.Monad.Catch.MonadCatch (HsDev.Database.Update.Types.UpdateDB m) instance Control.Monad.Catch.MonadThrow m => Control.Monad.Catch.MonadThrow (HsDev.Database.Update.Types.UpdateDB m) instance Control.Monad.CatchIO.MonadCatchIO m => Control.Monad.CatchIO.MonadCatchIO (HsDev.Database.Update.Types.UpdateDB m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (HsDev.Database.Update.Types.UpdateDB m) instance GHC.Base.Monad m => GHC.Base.Monad (HsDev.Database.Update.Types.UpdateDB m) instance GHC.Base.Applicative m => GHC.Base.Applicative (HsDev.Database.Update.Types.UpdateDB m) instance Data.Aeson.Types.Class.ToJSON HsDev.Database.Update.Types.Status instance Data.Aeson.Types.Class.FromJSON HsDev.Database.Update.Types.Status instance Data.Aeson.Types.Class.ToJSON HsDev.Database.Update.Types.Progress instance Data.Aeson.Types.Class.FromJSON HsDev.Database.Update.Types.Progress instance Data.Aeson.Types.Class.ToJSON HsDev.Database.Update.Types.Task instance Data.Aeson.Types.Class.FromJSON HsDev.Database.Update.Types.Task instance Control.Monad.CatchIO.MonadCatchIO m => Control.Monad.CatchIO.MonadCatchIO (Control.Monad.Trans.Except.ExceptT e m) instance Control.Monad.CatchIO.MonadCatchIO m => System.Log.Simple.Monad.MonadLog (HsDev.Database.Update.Types.UpdateDB m) instance System.Log.Simple.Monad.MonadLog m => System.Log.Simple.Monad.MonadLog (Control.Monad.Trans.Except.ExceptT e m) instance Control.Monad.Base.MonadBase b m => Control.Monad.Base.MonadBase b (HsDev.Database.Update.Types.UpdateDB m) instance Control.Monad.Trans.Control.MonadBaseControl b m => Control.Monad.Trans.Control.MonadBaseControl b (HsDev.Database.Update.Types.UpdateDB m) module HsDev.Cache.Structured -- | Write cache dump :: FilePath -> Structured -> IO () -- | Load all cache load :: FilePath -> IO (Either String Structured) -- | Load cabal from cache loadCabal :: Cabal -> FilePath -> ExceptT String IO Structured -- | Load project from cache loadProject :: FilePath -> FilePath -> ExceptT String IO Structured -- | Load standalone files loadFiles :: (FilePath -> Bool) -> FilePath -> ExceptT String IO Structured module HsDev.Database.Update data Status StatusWorking :: Status StatusOk :: Status StatusError :: String -> Status data Progress Progress :: Int -> Int -> Progress [progressCurrent] :: Progress -> Int [progressTotal] :: Progress -> Int data Task Task :: String -> Status -> String -> String -> Maybe Progress -> Task [taskName] :: Task -> String [taskStatus] :: Task -> Status [taskSubjectType] :: Task -> String [taskSubjectName] :: Task -> String [taskProgress] :: Task -> Maybe Progress isStatus :: Value -> Bool data Settings Settings :: Async Database -> ((FilePath -> ExceptT String IO Structured) -> IO (Maybe Database)) -> (Database -> IO ()) -> ([Task] -> IO ()) -> [String] -> Bool -> Bool -> Worker (ReaderT WorkerMap IO) -> Log -> Watcher -> [(String, String)] -> Settings [database] :: Settings -> Async Database [databaseCacheReader] :: Settings -> (FilePath -> ExceptT String IO Structured) -> IO (Maybe Database) [databaseCacheWriter] :: Settings -> Database -> IO () [onStatus] :: Settings -> [Task] -> IO () [ghcOptions] :: Settings -> [String] [updateDocs] :: Settings -> Bool [runInferTypes] :: Settings -> Bool [settingsGhcModWorker] :: Settings -> Worker (ReaderT WorkerMap IO) [settingsLogger] :: Settings -> Log [settingsWatcher] :: Settings -> Watcher [settingsDefines] :: Settings -> [(String, String)] settings :: CommandOptions -> [String] -> Bool -> Bool -> Settings data UpdateDB m a -- | Run UpdateDB monad updateDB :: (MonadBaseControl IO m, MonadCatchIO m) => Settings -> ExceptT String (UpdateDB m) () -> m () -- | Post status postStatus :: (MonadIO m, MonadReader Settings m) => Task -> m () -- | Wait DB to complete actions waiter :: (MonadIO m, MonadReader Settings m) => m () -> m () -- | Update task result to database updater :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => m Database -> m () -- | Get data from cache without updating DB loadCache :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => (FilePath -> ExceptT String IO Structured) -> m Database -- | Load data from cache if not loaded yet and wait getCache :: (MonadIO m, MonadReader Settings m, MonadWriter [ModuleLocation] m) => (FilePath -> ExceptT String IO Structured) -> (Database -> Database) -> m Database -- | Run one task runTask :: (Display t, MonadIO m, NFData a, MonadCatchIO m) => String -> t -> ExceptT String (UpdateDB m) a -> ExceptT String (UpdateDB m) a -- | Run many tasks with numeration runTasks :: Monad m => [ExceptT String (UpdateDB m) ()] -> ExceptT String (UpdateDB m) () -- | Get database value readDB :: (MonadIO m, MonadReader Settings m) => m Database -- | Scan module scanModule :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> ModuleLocation -> Maybe String -> ExceptT String (UpdateDB m) () -- | Scan modules scanModules :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> [ModuleToScan] -> ExceptT String (UpdateDB m) () -- | Scan source file scanFile :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> FilePath -> ExceptT String (UpdateDB m) () -- | Scan source file with contents scanFileContents :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> FilePath -> Maybe String -> ExceptT String (UpdateDB m) () -- | Scan cabal modules scanCabal :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> Cabal -> ExceptT String (UpdateDB m) () -- | Scan project file scanProjectFile :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> FilePath -> ExceptT String (UpdateDB m) Project -- | Scan project scanProject :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> FilePath -> ExceptT String (UpdateDB m) () -- | Scan directory for source files and projects scanDirectory :: (MonadIO m, MonadCatch m, MonadCatchIO m) => [String] -> FilePath -> ExceptT String (UpdateDB m) () -- | Scan docs for inspected modules scanDocs :: (MonadIO m, MonadCatchIO m) => [InspectedModule] -> ExceptT String (UpdateDB m) () inferModTypes :: (MonadIO m, MonadCatchIO m) => [InspectedModule] -> ExceptT String (UpdateDB m) () -- | Generic scan function. Reads cache only if data is not already loaded, -- removes obsolete modules and rescans changed modules. scan :: (MonadIO m, MonadCatch m, MonadCatchIO m) => (FilePath -> ExceptT String IO Structured) -> (Database -> Database) -> [ModuleToScan] -> [String] -> ([ModuleToScan] -> ExceptT String (UpdateDB m) ()) -> ExceptT String (UpdateDB m) () updateEvent :: (MonadIO m, MonadCatch m, MonadCatchIO m) => Watched -> Event -> ExceptT String (UpdateDB m) () processEvent :: Settings -> Watched -> Event -> IO () -- | Lift errors liftExceptT :: MonadIO m => ExceptT String IO a -> ExceptT String m a module HsDev.Client.Commands -- | Run command runCommand :: CommandOptions -> Command -> IO Result module HsDev.Server.Base -- | Inits log chan and returns functions (print message, wait channel) initLog :: ServerOpts -> IO (Log, Level -> String -> IO (), ([String] -> IO ()) -> IO (), IO ()) -- | Run server runServer :: ServerOpts -> (CommandOptions -> IO ()) -> IO () type Server = Worker (ReaderT CommandOptions IO) startServer :: ServerOpts -> IO Server inServer :: Server -> Command -> IO Result -- | Perform action on cache withCache :: ServerOpts -> a -> (FilePath -> IO a) -> IO a writeCache :: ServerOpts -> (Level -> String -> IO ()) -> Database -> IO () readCache :: ServerOpts -> (Level -> String -> IO ()) -> (FilePath -> ExceptT String IO Structured) -> IO (Maybe Database) instance Text.Format.FormatBuild System.Log.Simple.Base.Level module HsDev.Server.Commands -- | Server control command data ServerCommand Version :: ServerCommand Start :: ServerOpts -> ServerCommand Run :: ServerOpts -> ServerCommand Stop :: ClientOpts -> ServerCommand Connect :: ClientOpts -> ServerCommand Remote :: ClientOpts -> Bool -> Command -> ServerCommand -- | Server options data ServerOpts ServerOpts :: Int -> Int -> Maybe FilePath -> String -> Maybe FilePath -> Bool -> ServerOpts [serverPort] :: ServerOpts -> Int [serverTimeout] :: ServerOpts -> Int [serverLog] :: ServerOpts -> Maybe FilePath [serverLogConfig] :: ServerOpts -> String [serverCache] :: ServerOpts -> Maybe FilePath [serverLoad] :: ServerOpts -> Bool -- | Client options data ClientOpts ClientOpts :: Int -> Bool -> Bool -> Int -> Bool -> ClientOpts [clientPort] :: ClientOpts -> Int [clientPretty] :: ClientOpts -> Bool [clientStdin] :: ClientOpts -> Bool [clientTimeout] :: ClientOpts -> Int [clientSilent] :: ClientOpts -> Bool data Request Request :: Command -> FilePath -> Bool -> Int -> Bool -> Request [requestCommand] :: Request -> Command [requestDirectory] :: Request -> FilePath [requestNoFile] :: Request -> Bool [requestTimeout] :: Request -> Int [requestSilent] :: Request -> Bool sendCommand :: ClientOpts -> Bool -> Command -> (Notification -> IO a) -> IO Result runServerCommand :: ServerCommand -> IO () findPath :: MonadIO m => CommandOptions -> FilePath -> m FilePath -- | Process request, notifications can be sent during processing processRequest :: CommandOptions -> (Notification -> IO ()) -> Command -> IO Result -- | Process client, listen for requests and process them processClient :: String -> IO ByteString -> (ByteString -> IO ()) -> CommandOptions -> IO () -- | Process client by socket processClientSocket :: Socket -> CommandOptions -> IO ()