polysemy-1.3.0.0: Higher-order, low-boilerplate, zero-cost free monads.

Safe HaskellNone
LanguageHaskell2010

Polysemy.View

Contents

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 
Instances
type DefiningModule (View :: k1 -> k2 -> k1 -> Type) Source # 
Instance details

Defined in Polysemy.View

type DefiningModule (View :: k1 -> k2 -> k1 -> Type) = "Polysemy.View"

Actions

see :: forall v r. MemberWithError (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.