note potentially useful interval algebra link

This commit is contained in:
Simon Michael 2014-04-19 11:45:47 -07:00
parent d0461c3ef7
commit 6af5e6fe06

View File

@ -119,6 +119,8 @@ spanStart (DateSpan d _) = d
spanEnd :: DateSpan -> Maybe Day
spanEnd (DateSpan _ d) = d
-- might be useful later: http://en.wikipedia.org/wiki/Allen%27s_interval_algebra
-- | Get overall span enclosing multiple sequentially ordered spans.
spansSpan :: [DateSpan] -> DateSpan
spansSpan spans = DateSpan (maybe Nothing spanStart $ headMay spans) (maybe Nothing spanEnd $ lastMay spans)