| Safe Haskell | None | 
|---|
Utils.Katt.Utils
Description
Contains shared type declarations and various utility functions.
- type ConfigEnvInternal m = StateT ConfigState m
 - type ConfigEnv m = EitherT ErrorDesc (ConfigEnvInternal m)
 - type Submission = (KattisProblem, [FilePath])
 - type ErrorDesc = ByteString
 - type SubmissionId = Integer
 - type ProblemSession = Integer
 - type ProjectState = KattisProblem
 - data ConfigState = ConfigState {}
 - type Session = (Session, ByteString)
 - data KattisProblem
 - data  KattisLanguage 
- = LangCplusplus
 - | LangJava
 - | LangC
 - | LangHaskell
 
 - 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
 - defaultOpts :: Options
 - retrievePublicPage :: ByteString -> ConfigEnv IO ByteString
 - retrievePrivatePage :: Session -> ByteString -> EitherT ErrorDesc IO ByteString
 - buildURL :: ByteString -> ByteString -> String
 - withAuth :: (Session -> EitherT ErrorDesc IO a) -> ConfigEnv IO a
 - retrieveProblemId :: KattisProblem -> IO Integer
 - retrieveProblemName :: KattisProblem -> 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 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.
Constructors
| ConfigState | |
Fields 
  | |
Instances
type Session = (Session, ByteString)Source
HTTP client session and the host path.
data KattisProblem Source
A Kattis problem.
Constructors
| ProblemId Integer | Problem ID, unique.  | 
| ProblemName ByteString | Associated name of the problem.  | 
Instances
data KattisLanguage Source
Language used in submission.
Constructors
| LangCplusplus | C++.  | 
| LangJava | Java.  | 
| LangC | C.  | 
| LangHaskell | Haskell.  | 
Instances
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.
Default HTTP options.
retrievePublicPage :: ByteString -> ConfigEnv IO ByteStringSource
Retrieve a publicly available page, using HTTP GET.
retrievePrivatePage :: Session -> ByteString -> EitherT ErrorDesc IO ByteStringSource
Retrieve a page requiring authentication, using HTTP GET.
buildURL :: ByteString -> ByteString -> StringSource
Construct URL from host path (e.g. http:\/x.com/) and path (e.g. ).
withAuth :: (Session -> EitherT ErrorDesc IO a) -> ConfigEnv IO aSource
Authenticate and run the provided action.
retrieveProblemId :: KattisProblem -> IO IntegerSource
Retrieve problem ID of a Kattis problem.
retrieveProblemName :: KattisProblem -> IO ByteStringSource
Retrieve problem name of a Kattis problem.