Modularise your control

This commit is contained in:
2021-03-27 00:13:11 +01:00
parent 62b5ffbfaa
commit e6a57653b3
6 changed files with 132 additions and 113 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ playIfFree c times = do
mayChan <- Mix.getAvailable Mix.DefaultGroup
case mayChan of
Nothing -> return Nothing
Just i -> fmap Just $ Mix.playOn i times c
Just i -> Just <$> Mix.playOn i times c
haltMaybe :: Maybe Mix.Channel -> IO (Maybe Sound)
haltMaybe (Just x) = Mix.halt x >> return Nothing