Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Internal utilities and instances
Synopsis
- whileMFinalIO :: Member (Final IO) r => Sem r Bool -> Sem r ()
- untilJustFinalIO :: Member (Final IO) r => Sem r (Maybe a) -> Sem r a
- whenJust :: Applicative m => Maybe a -> (a -> m ()) -> m ()
- whenM :: Monad m => m Bool -> m () -> m ()
- unlessM :: Monad m => m Bool -> m () -> m ()
- lastMaybe :: Maybe a -> Maybe a -> Maybe a
- leftToMaybe :: Either e a -> Maybe e
- rightToMaybe :: Either e a -> Maybe a
- justToEither :: Maybe e -> Either e ()
- (<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)
- (<<*>>) :: (Applicative f, Applicative g) => f (g (a -> b)) -> f (g a) -> f (g b)
- (<.>) :: Functor f => (a -> b) -> (c -> f a) -> c -> f b
- (.?=) :: (ToJSON v, KeyValue kv) => Key -> Maybe v -> Maybe kv
- (.=) :: (ToJSON v, KeyValue kv) => Key -> v -> Maybe kv
- debug :: Member LogEff r => Text -> Sem r ()
- info :: Member LogEff r => Text -> Sem r ()
- error :: Member LogEff r => Text -> Sem r ()
- swap :: (a, b) -> (b, a)
- newtype DefaultingMap k v = DefaultingMap {
- unDefaultingMap :: Map k v
- newtype AesonVector a = AesonVector {
- unAesonVector :: Vector a
- newtype CalamityFromStringShow a = CalamityFromStringShow {}
- data MaybeNull a
- newtype CalamityToJSON a = CalamityToJSON a
- class CalamityToJSON' a where
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 #
leftToMaybe :: Either e a -> Maybe e Source #
rightToMaybe :: Either e a -> Maybe a Source #
justToEither :: Maybe e -> Either e () Source #
(<<*>>) :: (Applicative f, Applicative g) => f (g (a -> b)) -> f (g a) -> f (g b) infixl 4 Source #
newtype DefaultingMap k v Source #
DefaultingMap | |
|
Instances
Default (DefaultingMap k v) Source # | |
Defined in Calamity.Internal.Utils def :: DefaultingMap k v # |
newtype AesonVector a Source #
Instances
newtype CalamityFromStringShow a Source #
Instances
An alternative Maybe
type that allows us to distinguish between parsed
json fields that were null, and fields that didn't exist.
newtype CalamityToJSON a Source #
Instances
CalamityToJSON' a => ToJSON (CalamityToJSON a) Source # | |
Defined in Calamity.Internal.Utils toJSON :: CalamityToJSON a -> Value # toEncoding :: CalamityToJSON a -> Encoding # toJSONList :: [CalamityToJSON a] -> Value # toEncodingList :: [CalamityToJSON a] -> Encoding # |
class CalamityToJSON' a where Source #