codeforces-cli-0.1.0: Command line interface to interact with Codeforces.
Safe HaskellNone
LanguageHaskell2010

Codeforces.App.Format

Description

Utility functions for formatting data.

Synopsis

Documentation

showText :: Show a => a -> Text Source #

showText x is a Text version of show

colored :: Color -> Text -> Text Source #

colored color text wraps some text around SGR codes to display it in the given color.

diffColored :: Int -> Text Source #

Like differenceCell but returns a Text rather than a Cell.

fmtDiffTime :: NominalDiffTime -> Text Source #

Returns an approximate and human-friendly time difference.

Possible options are: * "just now" * "5 seconds ago" * "X seconds ago" where X is a multiple of 10 * "X minutes ago"

differenceCell :: Int -> Cell Source #

differenceCell diff colors a number red, white or green, depending on whether it's negative, 0, or positive.

verdictCell :: Testset -> Int -> Maybe Points -> Maybe Verdict -> Cell Source #

verdictCell testset passedTestCount points verdict returns a cell displaying the status of a submission, such as Accepted or "Wrong answer on pretest 2".