grisette-0.11.0.0: Symbolic evaluation as a library
Copyright(c) Sirui Lu 2021-2023
LicenseBSD-3-Clause (see the LICENSE file)
Maintainersiruilu@cs.washington.edu
StabilityExperimental
PortabilityGHC only
Safe HaskellTrustworthy
LanguageHaskell2010

Grisette.Internal.Core.Data.MemoUtils

Contents

Description

 
Synopsis

Memoization

stableMemo :: (a -> b) -> a -> b Source #

Memoize a unary function.

stableMemo2 :: (a -> b -> c) -> a -> b -> c Source #

Curried memoization to share partial evaluation

stableMemo3 :: (a -> b -> c -> d) -> a -> b -> c -> d Source #

Curried memoization to share partial evaluation

stableMup :: (b -> c) -> (a -> b) -> a -> c Source #

Lift a memoizer to work with one more argument.

stableMemoFix :: ((a -> b) -> a -> b) -> a -> b Source #

Memoizing recursion. Use like fix.

weakStableMemo :: (a -> b) -> a -> b Source #

Memoize a unary function.

weakStableMemo2 :: (a -> b -> c) -> a -> b -> c Source #

Curried memoization to share partial evaluation

weakStableMemo3 :: (a -> b -> c -> d) -> a -> b -> c -> d Source #

Curried memoization to share partial evaluation

weakStableMup :: (b -> c) -> (a -> b) -> a -> c Source #

Lift a memoizer to work with one more argument.

weakStableMemoFix :: ((a -> b) -> a -> b) -> a -> b Source #

Memoizing recursion. Use like fix.

htmemo :: (Eq k, Hashable k) => (k -> a) -> k -> a Source #

Function memoizer with mutable hash table.

htmemo2 :: (Eq k1, Hashable k1, Eq k2, Hashable k2) => (k1 -> k2 -> a) -> k1 -> k2 -> a Source #

Function memoizer with mutable hash table. Works on binary functions.

htmemo3 :: (Eq k1, Hashable k1, Eq k2, Hashable k2, Eq k3, Hashable k3) => (k1 -> k2 -> k3 -> a) -> k1 -> k2 -> k3 -> a Source #

Function memoizer with mutable hash table. Works on ternary functions.

htmemoFix :: (Eq k, Hashable k) => ((k -> a) -> k -> a) -> k -> a Source #

Memoizing recursion. Use like fix.

htmup :: (Eq k, Hashable k) => (b -> c) -> (k -> b) -> k -> c Source #

Lift a memoizer to work with one more argument.