yamemo-0.6.0: Simple memoisation function
Data.Function.YaMemo
Contents
Description
Memoisation. It's useful for dynamic programming.
Synopsis
module Data.Function.YaMemo.MemoTableClasses
type Memo t a b = a -> State (t a b) bSource
memo :: (MemoTable t, Ord a) => (a -> State (t a b) b) -> ((a -> State (t a b) b) -> Memo t a b) -> a -> bSource
makes memo function from functional specified by the second argument. The first argument is only for imforming type of memo table will be used.
memo' :: (MemoTable t, Ord a) => ((a -> State (t a b) b) -> Memo t a b) -> t a b -> a -> (t a b, b)Source
makes memo function which also takes and returns memo table , which can be reused.