Agda-2.5.2: A dependently typed functional programming language and proof assistant

Safe Haskell | None
Language | Haskell2010

Agda.Utils.Memo

Synopsis

- memo :: MonadState s m => Lens' (Maybe a) s -> m a -> m a
- memoRec :: MonadState s m => Lens' (Maybe a) s -> a -> m a -> m a
- memoUnsafe :: Ord a => (a -> b) -> a -> b
- memoUnsafeH :: (Eq a, Hashable a) => (a -> b) -> a -> b

# Documentation

memo :: MonadState s m => Lens' (Maybe a) s -> m a -> m a #

Simple, non-reentrant memoisation.

memoRec :: MonadState s m => Lens' (Maybe a) s -> a -> m a -> m a #

Recursive memoisation, second argument is the value you get on recursive calls.

memoUnsafe :: Ord a => (a -> b) -> a -> b #

memoUnsafeH :: (Eq a, Hashable a) => (a -> b) -> a -> b #