Copyright | (c) Levent Erkok |
---|---|
License | BSD3 |
Maintainer | erkokl@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Demonstrates how enumerations can be used with optimization, by properly defining your metric values.
Synopsis
- data Day
- type SDay = SBV Day
- isWeekend :: SDay -> SBool
- almostWeekend :: IO OptimizeResult
- weekendJustOver :: IO OptimizeResult
- firstWeekend :: IO OptimizeResult
Documentation
A simple enumeration
Instances
almostWeekend :: IO OptimizeResult Source #
Using optimization, find the latest day that is not a weekend. We have:
>>>
almostWeekend
Optimal model: almostWeekend = Fri :: Day last-day = 4 :: Word8
weekendJustOver :: IO OptimizeResult Source #
Using optimization, find the first day after the weekend. We have:
>>>
weekendJustOver
Optimal model: weekendJustOver = Mon :: Day first-day = 0 :: Word8
firstWeekend :: IO OptimizeResult Source #
Using optimization, find the first weekend day: We have:
>>>
firstWeekend
Optimal model: firstWeekend = Sat :: Day first-weekend = 5 :: Word8