Safe Haskell | None |
---|
Contains shared type declarations and various utility functions.
- type ConfigEnvInternal m = StateT ConfigState m
- type ConfigEnv m = EitherT ErrorDesc (ConfigEnvInternal m)
- type ConnEnvInternal m = StateT Connection (ConfigEnvInternal m)
- type ConnEnv m = EitherT ErrorDesc (ConnEnvInternal m)
- type AuthEnv m = EitherT ErrorDesc (ReaderT ByteString (ConnEnvInternal m))
- type Submission = (KattisProblem, [FilePath])
- type ErrorDesc = ByteString
- type SubmissionId = Integer
- type ProblemSession = Integer
- type ProjectState = KattisProblem
- data ConfigState = ConfigState {}
- data KattisProblem
- data KattisLanguage
- = LangCplusplus
- | LangJava
- | LangC
- loginSuccess :: ByteString
- inputTestExtension :: FilePath
- outputTestExtension :: FilePath
- programName :: ByteString
- configDir :: ByteString
- testFolder :: FilePath
- problemAddress :: ByteString
- unWrapTrans :: (Monad m, MonadTrans t) => EitherT e m a -> EitherT e (t m) a
- tryIO :: MonadIO m => IO a -> EitherT ErrorDesc m a
- tryIOMsg :: MonadIO m => ByteString -> IO a -> EitherT ErrorDesc m a
- terminateOnFailure :: MonadIO m => ErrorDesc -> EitherT ErrorDesc m a -> m a
- makeSignedRequest :: RequestBuilder () -> AuthEnv IO Request
- defaultRequest :: RequestBuilder ()
- reestablishConnection :: ConnEnv IO ()
- retrievePublicPage :: ByteString -> ConnEnv IO ByteString
- retrievePrivatePage :: ByteString -> AuthEnv IO ByteString
- makeRequest :: Request -> ConnEnv IO ByteString
- extractSessionHeader :: ByteString -> Maybe ByteString
- authenticate :: ConnEnv IO ByteString
- retrieveProblemId :: KattisProblem -> ConnEnv IO Integer
- retrieveProblemName :: KattisProblem -> ConnEnv IO ByteString
Documentation
type ConfigEnvInternal m = StateT ConfigState mSource
Configuration layer consisting of configuration state.
type ConfigEnv m = EitherT ErrorDesc (ConfigEnvInternal m)Source
Configuration layer wrapped with error handling.
type ConnEnvInternal m = StateT Connection (ConfigEnvInternal m)Source
Connection layer with connection state layered on the configuration layer.
type ConnEnv m = EitherT ErrorDesc (ConnEnvInternal m)Source
Connection layer wrapped with error handling.
type AuthEnv m = EitherT ErrorDesc (ReaderT ByteString (ConnEnvInternal m))Source
Authentication layer with token state and error handling, wrapping the connection layer.
type Submission = (KattisProblem, [FilePath])Source
Submissions consist of a problem identifier and a set of file paths.
type ErrorDesc = ByteStringSource
Error description alias.
type SubmissionId = IntegerSource
Submissions are identified with an integer id.
type ProblemSession = IntegerSource
Problem sessions are identified with an integer id.
type ProjectState = KattisProblemSource
Project-specific state consists of the problem name.
data ConfigState Source
Global configuration, initialized from the .kattisrc file.
ConfigState | |
|
data KattisProblem Source
A Kattis problem.
ProblemId Integer | Problem ID, unique. |
ProblemName ByteString | Associated name of the problem. |
loginSuccess :: ByteStringSource
Server response indicating successful login.
inputTestExtension :: FilePathSource
Extension of input test files.
outputTestExtension :: FilePathSource
Extension of reference ouput test files.
programName :: ByteStringSource
Name of this program.
Relative path to project-specific configuration directory.
Relative path to folder containing tests.
problemAddress :: ByteStringSource
URL to page with problem information, relative to host
.
unWrapTrans :: (Monad m, MonadTrans t) => EitherT e m a -> EitherT e (t m) aSource
Lift some error monad one layer.
tryIO :: MonadIO m => IO a -> EitherT ErrorDesc m aSource
Execute an IO action and catch any exceptions.
tryIOMsg :: MonadIO m => ByteString -> IO a -> EitherT ErrorDesc m aSource
Execute an IO action and catch any exceptions, tagged with description.
terminateOnFailure :: MonadIO m => ErrorDesc -> EitherT ErrorDesc m a -> m aSource
Evaluate an error action and terminate process upon failure.
makeSignedRequest :: RequestBuilder () -> AuthEnv IO RequestSource
Sign an existing HTTP request with a temporary token.
defaultRequest :: RequestBuilder ()Source
Default HTTP request.
reestablishConnection :: ConnEnv IO ()Source
Reestablish an existing connection. Useful in order to avoid timeouts related to keep-alive.
retrievePublicPage :: ByteString -> ConnEnv IO ByteStringSource
Retrieve a publically available page, using HTTP GET.
retrievePrivatePage :: ByteString -> AuthEnv IO ByteStringSource
Retrieve a page requiring authentication, using HTTP GET.
makeRequest :: Request -> ConnEnv IO ByteStringSource
Make a HTTP request and retrieve the server response body.
extractSessionHeader :: ByteString -> Maybe ByteStringSource
Extract correct temporary token from cookie header string.
authenticate :: ConnEnv IO ByteStringSource
Authenticate an existing connection, returns a temporary token. Basically the API token is used to acquire a session-specific token.
retrieveProblemId :: KattisProblem -> ConnEnv IO IntegerSource
Retrieve problem ID of a Kattis problem.
retrieveProblemName :: KattisProblem -> ConnEnv IO ByteStringSource
Retrieve problem name of a Kattis problem.