cooked-validators
Safe HaskellSafe-Inferred
LanguageHaskell2010

Cooked.Tweak.Update

Description

This module provides straightforward tweaks to modify parts of the current TxSkel based on various kinds of optics.

Synopsis

Setting tweaks

setTweak :: (Member Tweak effs, Is k A_Setter) => Optic' k is TxSkel a -> a -> Sem effs () Source #

The tweak that sets a certain value in the TxSkel.

isetTweak :: (Member Tweak effs, Is k A_Setter) => Optic' k (WithIx i) TxSkel a -> (i -> a) -> Sem effs () Source #

Like setTweak, but the value to set is computed from the index of each focus.

Overing tweaks

overTweak :: (Member Tweak effs, Is k A_Setter) => Optic k is TxSkel TxSkel a b -> (a -> b) -> Sem effs () Source #

The tweak that modifies a certain value in the TxSkel.

ioverTweak :: (Member Tweak effs, Is k A_Setter) => Optic k (WithIx i) TxSkel TxSkel a b -> (i -> a -> b) -> Sem effs () Source #

Like overTweak, but the modification of each focus also depends on its index.

Traversing tweaks

traverseTweak :: (Member Tweak effs, Is k A_Traversal) => Optic' k is TxSkel a -> (a -> Sem effs a) -> Sem effs () Source #

Like overTweak, but the modification of each focus runs in the tweak's effect stack. The foci are visited in the order in which they occur in the TxSkel.

itraverseTweak :: (Member Tweak effs, Is k A_Traversal) => Optic' k (WithIx is) TxSkel a -> (is -> a -> Sem effs a) -> Sem effs () Source #

Like traverseTweak, for indexed optics