calamity-0.1.28.4: A library for writing discord bots in haskell
Safe HaskellNone
LanguageHaskell2010

Calamity.Internal.Utils

Description

Internal utilities and instances

Synopsis

Documentation

whileMFinalIO :: Member (Final IO) r => Sem r Bool -> Sem r () Source #

Like whileM, but stateful effects are not preserved to mitigate memory leaks

This means Polysemy.Error won't work to break the loop, etc. Instead, Error/Alternative will just result in the loop quitting.

untilJustFinalIO :: Member (Final IO) r => Sem r (Maybe a) -> Sem r a Source #

Like untilJust, but stateful effects are not preserved to mitigate memory leaks

This means Polysemy.Error won't work to break the loop, etc. Instead, Error/Alternative will just result in another loop.

whenJust :: Applicative m => Maybe a -> (a -> m ()) -> m () Source #

whenM :: Monad m => m Bool -> m () -> m () Source #

unlessM :: Monad m => m Bool -> m () -> m () Source #

(<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b) infixl 4 Source #

(<<*>>) :: (Applicative f, Applicative g) => f (g (a -> b)) -> f (g a) -> f (g b) infixl 4 Source #

(<.>) :: Functor f => (a -> b) -> (c -> f a) -> c -> f b infixl 4 Source #

debug :: Member LogEff r => Text -> Sem r () Source #

info :: Member LogEff r => Text -> Sem r () Source #

error :: Member LogEff r => Text -> Sem r () Source #

swap :: (a, b) -> (b, a) Source #

Orphan instances

TextShow UTCTime Source # 
Instance details

(ToJSON a, Unboxable a) => ToJSON (Vector a) Source # 
Instance details

(FromJSON a, Unboxable a) => FromJSON (Vector a) Source # 
Instance details

(Show a, Fractional a) => TextShow (Colour a) Source # 
Instance details

(TextShow a, Unboxable a) => TextShow (Vector a) Source # 
Instance details

Default (Map k v) Source # 
Instance details

Methods

def :: Map k v #

(Show k, Show v) => TextShow (HashMap k v) Source # 
Instance details

Methods

showbPrec :: Int -> HashMap k v -> Builder #

showb :: HashMap k v -> Builder #

showbList :: [HashMap k v] -> Builder #

showtPrec :: Int -> HashMap k v -> Text #

showt :: HashMap k v -> Text #

showtList :: [HashMap k v] -> Text #

showtlPrec :: Int -> HashMap k v -> Text #

showtl :: HashMap k v -> Text #

showtlList :: [HashMap k v] -> Text #

(Show k, Show v) => TextShow (Map k v) Source # 
Instance details

Methods

showbPrec :: Int -> Map k v -> Builder #

showb :: Map k v -> Builder #

showbList :: [Map k v] -> Builder #

showtPrec :: Int -> Map k v -> Text #

showt :: Map k v -> Text #

showtList :: [Map k v] -> Text #

showtlPrec :: Int -> Map k v -> Text #

showtl :: Map k v -> Text #

showtlList :: [Map k v] -> Text #