The intention is to make the type class constraint code cleaner.
type CanThrowDice = (Monad m, MonadIO m, Random a)
throwDice :: CanThrowDice m a => (a, a) -> m a
throwDice (r1, r2) = ...
instead of writing:
throwDice :: (Monad m, MonadIO m, Random a) => (a, a) -> m a
throwDice (r1, r2) = ...
I remember seeing this usage somewhere but can't recall.
The above code warns to me add some extra pragma such as ConstraintKinds which I can't make it work.