Personal tools

Haskell Quiz/DayRange

From HaskellWiki

< Haskell Quiz
Revision as of 10:32, 13 January 2007 by Quale (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, 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.

1 The Problem

2 Solutions