Created
June 27, 2018 10:40
-
-
Save AlexeyRaga/b8d72412a4b7a83dcbd12e2f3ac504ac to your computer and use it in GitHub Desktop.
"Object Oriented Programming" in Haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Monad m => NotificationQueue m where | |
readNotifications :: m [Message] | |
ackNotification :: Message -> m () | |
class Repository m where | |
readRules :: S3Location -> m (Maybe [Rule]) | |
writePolicies :: S3Location -> [Policy] -> m (Maybe ETag) | |
readSubmissions :: ( NotificationQueue m | |
, Repository m | |
, Logging m) => m () | |
readSubmissions = do | |
msgs <- readNotifications | |
logInfo ("Received messages: " ++ show (length msgs)) | |
forM_ msgs $ \msg -> do | |
rules <- readRules (locationFromMessage msg) | |
error "Implement me" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment