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
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: last-day = Fri :: Day almostWeekend = Fri :: Day DayAsWord8(last-day) = 4 :: Word8
weekendJustOver :: IO OptimizeResult Source #
Using optimization, find the first day after the weekend. We have:
>>>
weekendJustOver
Optimal model: first-day = Mon :: Day weekendJustOver = Mon :: Day DayAsWord8(first-day) = 0 :: Word8
firstWeekend :: IO OptimizeResult Source #
Using optimization, find the first weekend day: We have:
>>>
firstWeekend
Optimal model: first-weekend = Sat :: Day firstWeekend = Sat :: Day DayAsWord8(first-weekend) = 5 :: Word8