Safe Haskell | None |
---|---|
Language | Haskell2010 |
An experimental idea to see if we can whole-sale cache the results of certain effect computations, when we can be confident that their repeated invocation should result in the same outcome. The idea is that a first interpretation of the effect stack (e.g. during a validation or dry run) can produce this memoization cache and repeated interpretations of the same effect during the same program session can just lookup results from th cache.
A good example is parsing of SQL files from disk. We'd want to do it once and have much faster resolution on repeat runs.
Documentation
Instances
CachableEffect (Example :: k -> Type -> Type) ExampleCachableEffect # | |
Defined in Polysemy.Memoize.Example | |
Eq (Example m a) # | |
Ord (Example m a) # | |
Defined in Polysemy.Memoize.Example |
runExample :: Sem (Example ': r) a -> Sem r a #
data ExampleCachableEffect #
Instances
CachableEffect (Example :: k -> Type -> Type) ExampleCachableEffect # | |
Defined in Polysemy.Memoize.Example |
cacheInput :: forall e r m a ce. (Eq (e m a), Ord (e m a), Member e r, Member (AtomicState (ResultCache ce)) r, e ~ Example, Member e ce) => Sem r a -> Sem r a #