polysemy-1.7.1.0: Higher-order, low-boilerplate free monads.
Safe HaskellNone
LanguageHaskell2010

Polysemy.View

Synopsis

Effect

data View v m a where Source #

A View is an expensive computation that should be cached.

Constructors

See :: View v m v 

Actions

see :: forall v r. Member (View v) r => Sem r v Source #

Interpretations

viewToState :: forall v s r a. Member (State s) r => (s -> Sem r v) -> Sem (View v ': r) a -> Sem r a Source #

Get a View as an exensive computation over an underlying State effect. This View is only invalidated when the underlying State changes.

viewToInput :: forall v i r a. Member (Input i) r => (i -> v) -> Sem (View v ': r) a -> Sem r a Source #

Transform a View into an Input.