Safe Haskell | None |
---|---|
Language | Haskell98 |
HsDev.Database.Update.Types
Synopsis
- data Status
- data Progress = Progress {}
- data Task = Task {}
- data UpdateOptions = UpdateOptions {
- _updateTasks :: [Task]
- _updateGhcOpts :: [String]
- _updateDocs :: Bool
- _updateInfer :: Bool
- updateTasks :: Lens' UpdateOptions [Task]
- updateGhcOpts :: Lens' UpdateOptions [String]
- updateDocs :: Lens' UpdateOptions Bool
- updateInfer :: Lens' UpdateOptions Bool
- data UpdateState = UpdateState {}
- updateOptions :: Lens' UpdateState UpdateOptions
- updateWorker :: Lens' UpdateState (Worker (ServerM IO))
- withUpdateState :: SessionMonad m => UpdateOptions -> (UpdateState -> m a) -> m a
- sendUpdateAction :: UpdateMonad m => ServerM IO () -> m ()
- newtype UpdateM m a = UpdateM {
- runUpdateM :: ReaderT UpdateState (WriterT [ModuleLocation] (ClientM m)) a
- type UpdateMonad m = (CommandMonad m, MonadReader UpdateState m, MonadWriter [ModuleLocation] m)
- taskName :: Lens' Task String
- taskStatus :: Lens' Task Status
- taskSubjectType :: Lens' Task String
- taskSubjectName :: Lens' Task String
- taskProgress :: Lens' Task (Maybe Progress)
- class FromCmd a where
- data SearchType
- data SearchQuery = SearchQuery Text SearchType
- data TargetFilter
- data FileSource = FileSource {
- fileSource :: Path
- fileContents :: Maybe Text
- data Request = Request {}
- data ClientOpts = ClientOpts {}
- data ServerOpts = ServerOpts {}
- data ConnectionPort
- data ServerCommand
- newtype ClientM m a = ClientM {
- runClientM :: ServerM (ReaderT CommandOptions m) a
- class (SessionMonad m, MonadPlus m) => CommandMonad m where
- getOptions :: m CommandOptions
- data CommandOptions = CommandOptions {
- commandOptionsRoot :: FilePath
- commandOptionsNotify :: Notification -> IO ()
- commandOptionsLink :: IO ()
- commandOptionsHold :: IO ()
- newtype ServerM m a = ServerM {
- runServerM :: ReaderT Session m a
- class (ServerMonadBase m, MonadLog m) => SessionMonad m where
- getSession :: m Session
- localSession :: (Session -> Session) -> m a -> m a
- data Session = Session {
- sessionSqlDatabase :: Connection
- sessionSqlPath :: String
- sessionLog :: SessionLog
- sessionWatcher :: Maybe Watcher
- sessionFileContents :: Path -> Maybe Text -> IO ()
- sessionGhc :: GhcWorker
- sessionUpdater :: Worker (ServerM IO)
- sessionResolveEnvironment :: LookupTable (Maybe Path) (Environment, FixitiesTable)
- sessionHTTPManager :: Manager
- sessionExit :: IO ()
- sessionWait :: IO ()
- sessionClients :: Chan (IO ())
- sessionDefines :: [(String, String)]
- data SessionLog = SessionLog {
- sessionLogger :: Log
- sessionListenLog :: IO [Message]
- sessionLogWait :: IO ()
- type ServerMonadBase m = (MonadIO m, MonadFail m, MonadMask m, MonadBaseControl IO m, Alternative m, MonadPlus m)
- askSession :: SessionMonad m => (Session -> a) -> m a
- askOptions :: CommandMonad m => (CommandOptions -> a) -> m a
- withSession :: Session -> ServerM m a -> m a
- serverListen :: SessionMonad m => m [Message]
- serverSetLogLevel :: SessionMonad m => Level -> m Level
- serverWait :: SessionMonad m => m ()
- serverWaitClients :: SessionMonad m => m ()
- serverSqlDatabase :: SessionMonad m => m Connection
- openSqlConnection :: SessionMonad m => m Connection
- closeSqlConnection :: SessionMonad m => Connection -> m ()
- withSqlConnection :: SessionMonad m => m a -> m a
- withSqlTransaction :: SessionMonad m => ServerM IO a -> m a
- serverSetFileContents :: SessionMonad m => Path -> Maybe Text -> m ()
- inSessionGhc :: SessionMonad m => GhcM a -> m a
- inSessionUpdater :: SessionMonad m => ServerM IO a -> m a
- postSessionUpdater :: SessionMonad m => ServerM IO a -> m (Async a)
- serverExit :: SessionMonad m => m ()
- commandRoot :: CommandMonad m => m FilePath
- commandNotify :: CommandMonad m => Notification -> m ()
- commandLink :: CommandMonad m => m ()
- commandHold :: CommandMonad m => m ()
- silentOpts :: ServerOpts
- serverOptsArgs :: ServerOpts -> [String]
Documentation
Constructors
StatusWorking | |
StatusOk | |
StatusError HsDevError |
Constructors
Progress | |
Fields
|
Constructors
Task | |
Fields |
data UpdateOptions Source #
Constructors
UpdateOptions | |
Fields
|
Instances
Default UpdateOptions Source # | |
Defined in HsDev.Database.Update.Types Methods def :: UpdateOptions # |
updateTasks :: Lens' UpdateOptions [Task] Source #
data UpdateState Source #
Constructors
UpdateState | |
Fields |
Instances
Monad m => MonadReader UpdateState (UpdateM m) Source # | |
Defined in HsDev.Database.Update.Types Methods ask :: UpdateM m UpdateState # local :: (UpdateState -> UpdateState) -> UpdateM m a -> UpdateM m a # reader :: (UpdateState -> a) -> UpdateM m a # |
updateWorker :: Lens' UpdateState (Worker (ServerM IO)) Source #
withUpdateState :: SessionMonad m => UpdateOptions -> (UpdateState -> m a) -> m a Source #
sendUpdateAction :: UpdateMonad m => ServerM IO () -> m () Source #
Constructors
UpdateM | |
Fields
|
Instances
type UpdateMonad m = (CommandMonad m, MonadReader UpdateState m, MonadWriter [ModuleLocation] m) Source #
class FromCmd a where Source #
Instances
FromCmd SearchQuery Source # | |
Defined in HsDev.Server.Types Methods cmdP :: Parser SearchQuery Source # | |
FromCmd TargetFilter Source # | |
Defined in HsDev.Server.Types Methods | |
FromCmd FileSource Source # | |
Defined in HsDev.Server.Types Methods cmdP :: Parser FileSource Source # | |
FromCmd Command Source # | |
FromCmd ClientOpts Source # | |
Defined in HsDev.Server.Types Methods cmdP :: Parser ClientOpts Source # | |
FromCmd ServerOpts Source # | |
Defined in HsDev.Server.Types Methods cmdP :: Parser ServerOpts Source # | |
FromCmd ServerCommand Source # | |
Defined in HsDev.Server.Types Methods |
data SearchType Source #
Constructors
SearchExact | |
SearchPrefix | |
SearchInfix | |
SearchSuffix |
Instances
Show SearchType Source # | |
Defined in HsDev.Server.Types Methods showsPrec :: Int -> SearchType -> ShowS # show :: SearchType -> String # showList :: [SearchType] -> ShowS # | |
ToJSON SearchType Source # | |
Defined in HsDev.Server.Types Methods toJSON :: SearchType -> Value # toEncoding :: SearchType -> Encoding # toJSONList :: [SearchType] -> Value # toEncodingList :: [SearchType] -> Encoding # | |
FromJSON SearchType Source # | |
Defined in HsDev.Server.Types |
data SearchQuery Source #
Constructors
SearchQuery Text SearchType |
Instances
Show SearchQuery Source # | |
Defined in HsDev.Server.Types Methods showsPrec :: Int -> SearchQuery -> ShowS # show :: SearchQuery -> String # showList :: [SearchQuery] -> ShowS # | |
ToJSON SearchQuery Source # | |
Defined in HsDev.Server.Types Methods toJSON :: SearchQuery -> Value # toEncoding :: SearchQuery -> Encoding # toJSONList :: [SearchQuery] -> Value # toEncodingList :: [SearchQuery] -> Encoding # | |
FromJSON SearchQuery Source # | |
Defined in HsDev.Server.Types | |
FromCmd SearchQuery Source # | |
Defined in HsDev.Server.Types Methods cmdP :: Parser SearchQuery Source # |
data TargetFilter Source #
Constructors
TargetProject Text | |
TargetFile Path | |
TargetModule Text | |
TargetPackage Text | |
TargetInstalled | |
TargetSourced | |
TargetStandalone |
Instances
Eq TargetFilter Source # | |
Defined in HsDev.Server.Types | |
Show TargetFilter Source # | |
Defined in HsDev.Server.Types Methods showsPrec :: Int -> TargetFilter -> ShowS # show :: TargetFilter -> String # showList :: [TargetFilter] -> ShowS # | |
ToJSON TargetFilter Source # | |
Defined in HsDev.Server.Types Methods toJSON :: TargetFilter -> Value # toEncoding :: TargetFilter -> Encoding # toJSONList :: [TargetFilter] -> Value # toEncodingList :: [TargetFilter] -> Encoding # | |
FromJSON TargetFilter Source # | |
Defined in HsDev.Server.Types | |
FromCmd TargetFilter Source # | |
Defined in HsDev.Server.Types Methods | |
Paths TargetFilter Source # | |
Defined in HsDev.Server.Types Methods |
data FileSource Source #
Constructors
FileSource | |
Fields
|
Instances
Show FileSource Source # | |
Defined in HsDev.Server.Types Methods showsPrec :: Int -> FileSource -> ShowS # show :: FileSource -> String # showList :: [FileSource] -> ShowS # | |
ToJSON FileSource Source # | |
Defined in HsDev.Server.Types Methods toJSON :: FileSource -> Value # toEncoding :: FileSource -> Encoding # toJSONList :: [FileSource] -> Value # toEncodingList :: [FileSource] -> Encoding # | |
FromJSON FileSource Source # | |
Defined in HsDev.Server.Types | |
FromCmd FileSource Source # | |
Defined in HsDev.Server.Types Methods cmdP :: Parser FileSource Source # | |
Paths FileSource Source # | |
Defined in HsDev.Server.Types Methods | |
EnumContents FileSource Source # | |
Defined in HsDev.Scan Methods enumContents :: CommandMonad m => FileSource -> m ScanContents Source # |
Constructors
Request | |
Fields
|
data ClientOpts Source #
Client options
Constructors
ClientOpts | |
Fields
|
Instances
Show ClientOpts Source # | |
Defined in HsDev.Server.Types Methods showsPrec :: Int -> ClientOpts -> ShowS # show :: ClientOpts -> String # showList :: [ClientOpts] -> ShowS # | |
Default ClientOpts Source # | |
Defined in HsDev.Server.Types Methods def :: ClientOpts # | |
FromCmd ClientOpts Source # | |
Defined in HsDev.Server.Types Methods cmdP :: Parser ClientOpts Source # |
data ServerOpts Source #
Server options
Constructors
ServerOpts | |
Fields
|
Instances
Show ServerOpts Source # | |
Defined in HsDev.Server.Types Methods showsPrec :: Int -> ServerOpts -> ShowS # show :: ServerOpts -> String # showList :: [ServerOpts] -> ShowS # | |
Default ServerOpts Source # | |
Defined in HsDev.Server.Types Methods def :: ServerOpts # | |
FromCmd ServerOpts Source # | |
Defined in HsDev.Server.Types Methods cmdP :: Parser ServerOpts Source # |
data ConnectionPort Source #
Constructors
NetworkPort Int | |
UnixPort String |
Instances
Eq ConnectionPort Source # | |
Defined in HsDev.Server.Types Methods (==) :: ConnectionPort -> ConnectionPort -> Bool # (/=) :: ConnectionPort -> ConnectionPort -> Bool # | |
Read ConnectionPort Source # | |
Defined in HsDev.Server.Types Methods readsPrec :: Int -> ReadS ConnectionPort # readList :: ReadS [ConnectionPort] # | |
Show ConnectionPort Source # | |
Defined in HsDev.Server.Types Methods showsPrec :: Int -> ConnectionPort -> ShowS # show :: ConnectionPort -> String # showList :: [ConnectionPort] -> ShowS # | |
Default ConnectionPort Source # | |
Defined in HsDev.Server.Types Methods def :: ConnectionPort # | |
Formattable ConnectionPort Source # | |
Defined in HsDev.Server.Types Methods formattable :: ConnectionPort -> FormatFlags -> Formatted # |
data ServerCommand Source #
Server control command
Constructors
Version Bool | |
Start ServerOpts | |
Run ServerOpts | |
Stop ClientOpts | |
Connect ClientOpts | |
Remote ClientOpts Bool Command |
Instances
Show ServerCommand Source # | |
Defined in HsDev.Server.Types Methods showsPrec :: Int -> ServerCommand -> ShowS # show :: ServerCommand -> String # showList :: [ServerCommand] -> ShowS # | |
FromCmd ServerCommand Source # | |
Defined in HsDev.Server.Types Methods |
Constructors
ClientM | |
Fields
|
Instances
class (SessionMonad m, MonadPlus m) => CommandMonad m where Source #
Methods
getOptions :: m CommandOptions Source #
Instances
ServerMonadBase m => CommandMonad (ClientM m) Source # | |
Defined in HsDev.Server.Types Methods | |
ServerMonadBase m => CommandMonad (UpdateM m) Source # | |
Defined in HsDev.Database.Update.Types Methods | |
(CommandMonad m, Monoid w) => CommandMonad (WriterT w m) Source # | |
Defined in HsDev.Server.Types Methods getOptions :: WriterT w m CommandOptions Source # | |
CommandMonad m => CommandMonad (StateT s m) Source # | |
Defined in HsDev.Server.Types Methods getOptions :: StateT s m CommandOptions Source # | |
CommandMonad m => CommandMonad (ReaderT r m) Source # | |
Defined in HsDev.Server.Types Methods getOptions :: ReaderT r m CommandOptions Source # |
data CommandOptions Source #
Constructors
CommandOptions | |
Fields
|
Instances
Default CommandOptions Source # | |
Defined in HsDev.Server.Types Methods def :: CommandOptions # |
Constructors
ServerM | |
Fields
|
Instances
class (ServerMonadBase m, MonadLog m) => SessionMonad m where Source #
Instances
ServerMonadBase m => SessionMonad (ClientM m) Source # | |
Defined in HsDev.Server.Types | |
ServerMonadBase m => SessionMonad (ServerM m) Source # | |
Defined in HsDev.Server.Types | |
ServerMonadBase m => SessionMonad (UpdateM m) Source # | |
Defined in HsDev.Database.Update.Types | |
(SessionMonad m, Monoid w) => SessionMonad (WriterT w m) Source # | |
Defined in HsDev.Server.Types | |
SessionMonad m => SessionMonad (StateT s m) Source # | |
Defined in HsDev.Server.Types | |
SessionMonad m => SessionMonad (ReaderT r m) Source # | |
Defined in HsDev.Server.Types |
Constructors
Session | |
Fields
|
data SessionLog Source #
Constructors
SessionLog | |
Fields
|
type ServerMonadBase m = (MonadIO m, MonadFail m, MonadMask m, MonadBaseControl IO m, Alternative m, MonadPlus m) Source #
askSession :: SessionMonad m => (Session -> a) -> m a Source #
askOptions :: CommandMonad m => (CommandOptions -> a) -> m a Source #
withSession :: Session -> ServerM m a -> m a Source #
Run action on session
serverListen :: SessionMonad m => m [Message] Source #
Listen server's log
serverSetLogLevel :: SessionMonad m => Level -> m Level Source #
Set server's log config
serverWait :: SessionMonad m => m () Source #
Wait for server
serverWaitClients :: SessionMonad m => m () Source #
Wait while clients disconnects
serverSqlDatabase :: SessionMonad m => m Connection Source #
Get sql connection
openSqlConnection :: SessionMonad m => m Connection Source #
Open new sql connection
closeSqlConnection :: SessionMonad m => Connection -> m () Source #
Close sql connection
withSqlConnection :: SessionMonad m => m a -> m a Source #
Locally opens new connection, updating Session
withSqlTransaction :: SessionMonad m => ServerM IO a -> m a Source #
With sql transaction
serverSetFileContents :: SessionMonad m => Path -> Maybe Text -> m () Source #
Set custom file contents
inSessionGhc :: SessionMonad m => GhcM a -> m a Source #
In ghc session
inSessionUpdater :: SessionMonad m => ServerM IO a -> m a Source #
In updater
postSessionUpdater :: SessionMonad m => ServerM IO a -> m (Async a) Source #
Post to updater and return
serverExit :: SessionMonad m => m () Source #
Exit session
commandRoot :: CommandMonad m => m FilePath Source #
commandNotify :: CommandMonad m => Notification -> m () Source #
commandLink :: CommandMonad m => m () Source #
commandHold :: CommandMonad m => m () Source #
silentOpts :: ServerOpts Source #
Silent server with no connection, useful for ghci
serverOptsArgs :: ServerOpts -> [String] Source #