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

Safe HaskellSafe
LanguageHaskell98

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 Line Source #

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

type Line = Text Source #

empty :: Log Source #

O(1) No logs here.

null :: Log -> Bool Source #

O(1) Check if the log is empty.

toString :: Log -> String Source #

O(n) Convert a Log to a String.

fromString :: String -> Log Source #

O(n) Convert a String to a Log.

(<|) :: Line -> Log -> Log Source #

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

(|>) :: Log -> Line -> Log Source #

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

(><) :: Log -> Log -> Log Source #

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

firstLines :: Int -> Log -> Log Source #

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

lastLines :: Int -> Log -> Log Source #

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