data-effects-0.1.2.0: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2024 Yamada Ryo
LicenseMPL-2.0 (see the file LICENSE)
Maintainerymdfield@outlook.jp
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageGHC2021

Data.Effect.KVStore

Description

This module provides the KVStore effect, comes from Polysemy.KVStore in the polysemy-kvstore package.

Documentation

data KVStore k v a where Source #

Constructors

LookupKV :: k -> KVStore k v (Maybe v) 
UpdateKV :: k -> Maybe v -> KVStore k v () 

type LKVStore k v = LiftIns (KVStore k v) Source #

pattern LUpdateKV :: () => (a ~ (), ()) => k -> Maybe v -> LiftIns (KVStore k v) f a Source #

pattern LLookupKV :: () => (a ~ Maybe v, ()) => k -> LiftIns (KVStore k v) f a Source #

updateKV'' :: forall key (k :: Type) (v :: Type) f. SendInsBy key (KVStore k v) f => k -> Maybe v -> f () Source #

updateKV' :: forall tag (k :: Type) (v :: Type) f. SendIns (Tag (KVStore k v) tag) f => k -> Maybe v -> f () Source #

updateKV :: forall (k :: Type) (v :: Type) f. SendIns (KVStore k v) f => k -> Maybe v -> f () Source #

lookupKV'' :: forall key (k :: Type) (v :: Type) f. SendInsBy key (KVStore k v) f => k -> f (Maybe v) Source #

lookupKV' :: forall tag (k :: Type) (v :: Type) f. SendIns (Tag (KVStore k v) tag) f => k -> f (Maybe v) Source #

lookupKV :: forall (k :: Type) (v :: Type) f. SendIns (KVStore k v) f => k -> f (Maybe v) Source #

lookupOrThrowKV :: (KVStore k v <: m, Throw e <: m, Monad m) => (k -> e) -> k -> m v Source #

existsKV :: forall v k f. (KVStore k v <: f, Functor f) => k -> f Bool Source #

writeKV :: KVStore k v <: f => k -> v -> f () Source #

deleteKV :: forall v k f. KVStore k v <: f => k -> f () Source #

modifyKV :: (KVStore k v <: m, Monad m) => v -> (v -> v) -> k -> m () Source #