Haskell Quiz/DayRange

From HaskellWiki
Jump to navigation Jump to search

DayRange (#92)

If you've ever created a web application that deals with scheduling recurring events, you may have found yourself creating a method to convert a list of days into a more human-readable string.

For example, suppose a musician plays at a certain venue on Monday, Tuesday, Wednesday, and Saturday. You could pass a list of associated day numbers to your object or method, which might return "Mon-Wed, Sat".

The purpose of this quiz is to find the best "Haskell way" to generate this sentence-like string.

The Problem

Solutions