hsdev-0.3.1.3: Haskell development library

Safe HaskellNone
LanguageHaskell98

HsDev.Server.Types

Synopsis

Documentation

askSession :: SessionMonad m => (Session -> a) -> m a Source #

newtype ServerM m a Source #

Constructors

ServerM 

Fields

Instances

MonadTrans ServerM Source # 

Methods

lift :: Monad m => m a -> ServerM m a #

Monad m => MonadReader Session (ServerM m) Source # 

Methods

ask :: ServerM m Session #

local :: (Session -> Session) -> ServerM m a -> ServerM m a #

reader :: (Session -> a) -> ServerM m a #

MonadBase b m => MonadBase b (ServerM m) Source # 

Methods

liftBase :: b α -> ServerM m α #

MonadBaseControl b m => MonadBaseControl b (ServerM m) Source # 

Associated Types

type StM (ServerM m :: * -> *) a :: * #

Methods

liftBaseWith :: (RunInBase (ServerM m) b -> b a) -> ServerM m a #

restoreM :: StM (ServerM m) a -> ServerM m a #

Monad m => Monad (ServerM m) Source # 

Methods

(>>=) :: ServerM m a -> (a -> ServerM m b) -> ServerM m b #

(>>) :: ServerM m a -> ServerM m b -> ServerM m b #

return :: a -> ServerM m a #

fail :: String -> ServerM m a #

Functor m => Functor (ServerM m) Source # 

Methods

fmap :: (a -> b) -> ServerM m a -> ServerM m b #

(<$) :: a -> ServerM m b -> ServerM m a #

Applicative m => Applicative (ServerM m) Source # 

Methods

pure :: a -> ServerM m a #

(<*>) :: ServerM m (a -> b) -> ServerM m a -> ServerM m b #

liftA2 :: (a -> b -> c) -> ServerM m a -> ServerM m b -> ServerM m c #

(*>) :: ServerM m a -> ServerM m b -> ServerM m b #

(<*) :: ServerM m a -> ServerM m b -> ServerM m a #

MonadPlus m => MonadPlus (ServerM m) Source # 

Methods

mzero :: ServerM m a #

mplus :: ServerM m a -> ServerM m a -> ServerM m a #

Alternative m => Alternative (ServerM m) Source # 

Methods

empty :: ServerM m a #

(<|>) :: ServerM m a -> ServerM m a -> ServerM m a #

some :: ServerM m a -> ServerM m [a] #

many :: ServerM m a -> ServerM m [a] #

MonadIO m => MonadIO (ServerM m) Source # 

Methods

liftIO :: IO a -> ServerM m a #

MonadThrow m => MonadThrow (ServerM m) Source # 

Methods

throwM :: Exception e => e -> ServerM m a #

MonadCatch m => MonadCatch (ServerM m) Source # 

Methods

catch :: Exception e => ServerM m a -> (e -> ServerM m a) -> ServerM m a #

MonadMask m => MonadMask (ServerM m) Source # 

Methods

mask :: ((forall a. ServerM m a -> ServerM m a) -> ServerM m b) -> ServerM m b #

uninterruptibleMask :: ((forall a. ServerM m a -> ServerM m a) -> ServerM m b) -> ServerM m b #

(MonadIO m, MonadMask m) => MonadLog (ServerM m) Source # 

Methods

askLog :: ServerM m Log #

localLog :: (Log -> Log) -> ServerM m a -> ServerM m a #

ServerMonadBase m => SessionMonad (ServerM m) Source # 
MFunctor * ServerM Source # 

Methods

hoist :: Monad m => (forall a. m a -> n a) -> t m b -> t n b #

type StM (ServerM m) a Source # 
type StM (ServerM m) a = StM (ReaderT * Session m) a

newtype ClientM m a Source #

Constructors

ClientM 

Instances

MonadTrans ClientM Source # 

Methods

lift :: Monad m => m a -> ClientM m a #

MonadBase b m => MonadBase b (ClientM m) Source # 

Methods

liftBase :: b α -> ClientM m α #

MonadBaseControl b m => MonadBaseControl b (ClientM m) Source # 

Associated Types

type StM (ClientM m :: * -> *) a :: * #

Methods

liftBaseWith :: (RunInBase (ClientM m) b -> b a) -> ClientM m a #

restoreM :: StM (ClientM m) a -> ClientM m a #

Monad m => Monad (ClientM m) Source # 

Methods

(>>=) :: ClientM m a -> (a -> ClientM m b) -> ClientM m b #

(>>) :: ClientM m a -> ClientM m b -> ClientM m b #

return :: a -> ClientM m a #

fail :: String -> ClientM m a #

Functor m => Functor (ClientM m) Source # 

Methods

fmap :: (a -> b) -> ClientM m a -> ClientM m b #

(<$) :: a -> ClientM m b -> ClientM m a #

Applicative m => Applicative (ClientM m) Source # 

Methods

pure :: a -> ClientM m a #

(<*>) :: ClientM m (a -> b) -> ClientM m a -> ClientM m b #

liftA2 :: (a -> b -> c) -> ClientM m a -> ClientM m b -> ClientM m c #

(*>) :: ClientM m a -> ClientM m b -> ClientM m b #

(<*) :: ClientM m a -> ClientM m b -> ClientM m a #

MonadPlus m => MonadPlus (ClientM m) Source # 

Methods

mzero :: ClientM m a #

mplus :: ClientM m a -> ClientM m a -> ClientM m a #

Alternative m => Alternative (ClientM m) Source # 

Methods

empty :: ClientM m a #

(<|>) :: ClientM m a -> ClientM m a -> ClientM m a #

some :: ClientM m a -> ClientM m [a] #

many :: ClientM m a -> ClientM m [a] #

MonadIO m => MonadIO (ClientM m) Source # 

Methods

liftIO :: IO a -> ClientM m a #

MonadThrow m => MonadThrow (ClientM m) Source # 

Methods

throwM :: Exception e => e -> ClientM m a #

MonadCatch m => MonadCatch (ClientM m) Source # 

Methods

catch :: Exception e => ClientM m a -> (e -> ClientM m a) -> ClientM m a #

MonadMask m => MonadMask (ClientM m) Source # 

Methods

mask :: ((forall a. ClientM m a -> ClientM m a) -> ClientM m b) -> ClientM m b #

uninterruptibleMask :: ((forall a. ClientM m a -> ClientM m a) -> ClientM m b) -> ClientM m b #

(MonadIO m, MonadMask m) => MonadLog (ClientM m) Source # 

Methods

askLog :: ClientM m Log #

localLog :: (Log -> Log) -> ClientM m a -> ClientM m a #

ServerMonadBase m => CommandMonad (ClientM m) Source # 
ServerMonadBase m => SessionMonad (ClientM m) Source # 
MFunctor * ClientM Source # 

Methods

hoist :: Monad m => (forall a. m a -> n a) -> t m b -> t n b #

type StM (ClientM 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

silentOpts :: ServerOpts Source #

Silent server with no connection, useful for ghci

data Command Source #

Command from client

Constructors

Ping 
Listen (Maybe String) 
SetLogLevel String 
Scan 
SetFileContents Path (Maybe Text) 
RefineDocs 

Fields

InferTypes 

Fields

Remove 
RemoveAll 
InfoPackages 
InfoProjects 
InfoSandboxes 
InfoSymbol SearchQuery [TargetFilter] Bool Bool 
InfoModule SearchQuery [TargetFilter] Bool Bool 
InfoProject (Either Text Path) 
InfoSandbox Path 
Lookup Text Path 
Whois Text Path 
Whoat Int Int Path 
ResolveScopeModules SearchQuery Path 
ResolveScope SearchQuery Path 
FindUsages Int Int Path 
Complete Text Bool Path 
Hayoo 
CabalList 

Fields

UnresolvedSymbols 

Fields

Lint 
Check 
CheckLint 
Types 
AutoFix [Note OutputMessage] 
Refactor [Note Refact] [Note Refact] Bool 
Rename Text Text Path 
GhcEval 
GhcType 
Langs 
Flags 
Link 

Fields

StopGhc 
Exit