calamity-0.1.30.2: 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 #

newtype DefaultingMap k v Source #

Constructors

DefaultingMap 

Fields

Instances

Instances details
Default (DefaultingMap k v) Source # 
Instance details

Defined in Calamity.Internal.Utils

Methods

def :: DefaultingMap k v

newtype AesonVector a Source #

Constructors

AesonVector 

Fields

Instances

Instances details
(Show a, Unboxable a) => Show (AesonVector a) Source # 
Instance details

Defined in Calamity.Internal.Utils

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

Defined in Calamity.Internal.Utils

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

Defined in Calamity.Internal.Utils

Methods

parseJSON :: Value -> Parser (AesonVector a)

parseJSONList :: Value -> Parser [AesonVector a]

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

Defined in Calamity.Internal.Utils

Methods

toJSON :: AesonVector a -> Value

toEncoding :: AesonVector a -> Encoding

toJSONList :: [AesonVector a] -> Value

toEncodingList :: [AesonVector a] -> Encoding