diff options
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r-- | Assistant/Alert.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs index 18f3ffa5d..4a3b2cf72 100644 --- a/Assistant/Alert.hs +++ b/Assistant/Alert.hs @@ -37,7 +37,15 @@ data Alert = Alert } {- Higher AlertId indicates a more recent alert. -} -type AlertId = Integer +newtype AlertId = AlertId Integer + deriving (Read, Show, Eq, Ord) + +{- Note: This first alert id is used for yesod's message. -} +firstAlertId :: AlertId +firstAlertId = AlertId 0 + +nextAlertId :: AlertId -> AlertId +nextAlertId (AlertId i) = AlertId $ succ i type AlertPair = (AlertId, Alert) |