data-effects-0.3.0.1: A basic framework for effect systems based on effects represented by GADTs.
Copyright(c) 2024 Sayo Koyoneda
LicenseMPL-2.0 (see the file LICENSE)
Maintainer[email protected]
Stabilityexperimental
Portabilityportable
Safe HaskellNone
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 :: forall k v. k -> KVStore k v (Maybe v) 
UpdateKV :: forall k v. k -> Maybe v -> KVStore k v () 

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

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

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

lookupKV :: SendFOE (KVStore k v) f => k -> f (Maybe v) Source #

lookupKV' :: forall {k1} (tag :: k1) k2 v f. SendFOE (Tag (KVStore k2 v) tag) f => k2 -> f (Maybe v) Source #

lookupKV'' :: forall {k1} (key :: k1) k2 v f. SendFOEBy key (KVStore k2 v) f => k2 -> f (Maybe v) Source #

updateKV :: SendFOE (KVStore k v) f => k -> Maybe v -> f () Source #

updateKV' :: forall {k1} (tag :: k1) k2 v f. SendFOE (Tag (KVStore k2 v) tag) f => k2 -> Maybe v -> f () Source #

updateKV'' :: forall {k1} (key :: k1) k2 v f. SendFOEBy key (KVStore k2 v) f => k2 -> Maybe v -> f () 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 #