grisette-0.1.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.Core.Data.MemoUtils

Description

 
Synopsis

Hashtable-based memoization

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.

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

Lift a memoizer to work with one more argument.

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

Memoizing recursion. Use like fix.