B:BD[
2.870] → [
2.870:1105]
reduce :: ([LogEntry], [LogInterval]) -> ([LogEntry], [LogInterval])
reduce ((LogEntry addr end StopWork) : (LogEntry _ start StartWork) : xs, intervals) = (xs, (LogInterval addr (interval start end)) : intervals)
reduce other = other
reduceToIntervals :: ([LogEntry], [LogInterval]) -> ([LogEntry], [LogInterval])
reduceToIntervals ((LogEntry addr end StopWork) : (LogEntry _ start StartWork) : xs, intervals) = (xs, (LogInterval addr (interval start end)) : intervals)
reduceToIntervals misaligned = misaligned