discord-haskell-voice-2.1.0: Voice support for discord-haskell.
Copyright(c) Yuto Takano (2021)
LicenseMIT
Maintainermoa17stock@gmail.com
Safe HaskellNone
LanguageHaskell2010

Discord.Internal.Voice.CommonUtils

Description

WARNING

This module is considered internal.

The Package Versioning Policy does not apply.

The contents of this module may change in any way whatsoever and without any warning between minor versions of this package.

Description

This module provides useful utility functions used in discord-haskell-voice.

Synopsis

Documentation

tshow :: Show a => a -> Text Source #

tshow is a shorthand alias for T.pack . show.

maybeToRight :: a -> Maybe b -> Either a b Source #

maybeToRight puts the maybe value into the right hand side of the Either, with a default value provided for the Left as the first argument.

doOrTimeout :: Int -> IO a -> IO (Maybe a) Source #

doOrTimeout performs an IO action for a maximum of millisec milliseconds.

killWkThread :: Weak ThreadId -> IO () Source #

killWkThread kills a thread referenced by Weak ThreadId. If the thread is no longer alive (that is, if deRefWeak is Nothing), this function will do nothing.