buildbox-2.1.2.4: Rehackable components for writing buildbots and test harnesses.

Safe HaskellSafe-Inferred

BuildBox.Data.Log

Description

When the output of a command is long, keeping it as a String is a bad idea.

Synopsis

Documentation

type Log = Seq LineSource

A sequence of lines, without newline charaters on the end.

empty :: LogSource

O(1) No logs here.

null :: Log -> BoolSource

O(1) Check if the log is empty.

toString :: Log -> StringSource

O(n) Convert a Log to a String.

fromString :: String -> LogSource

O(n) Convert a String to a Log.

(<|) :: Line -> Log -> LogSource

O(1) Add a Line to the start of a Log.

(|>) :: Log -> Line -> LogSource

O(1) Add a Line to the end of a Log.

(><) :: Log -> Log -> LogSource

O(log(min(n1,n2))) Concatenate two Logs.

firstLines :: Int -> Log -> LogSource

O(n) Take the first m lines from a log

lastLines :: Int -> Log -> LogSource

O(n) Take the last m lines from a log