From 020975555e4c6f808d3de43c89d5e20f831598f1 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 14 Apr 2014 08:31:34 -0700 Subject: [PATCH] clarify splitSpan function --- hledger-lib/Hledger/Data/Dates.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hledger-lib/Hledger/Data/Dates.hs b/hledger-lib/Hledger/Data/Dates.hs index 9c16862b1..9fc13e6c7 100644 --- a/hledger-lib/Hledger/Data/Dates.hs +++ b/hledger-lib/Hledger/Data/Dates.hs @@ -123,7 +123,8 @@ spanEnd (DateSpan _ d) = d spansSpan :: [DateSpan] -> DateSpan spansSpan spans = DateSpan (maybe Nothing spanStart $ headMay spans) (maybe Nothing spanEnd $ lastMay spans) --- | Split a DateSpan into one or more consecutive spans at the specified interval. +-- | Split a DateSpan into one or more consecutive whole spans of the specified length which enclose it. +-- If no interval is specified, the original span is returned. splitSpan :: Interval -> DateSpan -> [DateSpan] splitSpan _ (DateSpan Nothing Nothing) = [DateSpan Nothing Nothing] splitSpan NoInterval s = [s]