Skip to content

dorchard/array-memoize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Memoization combinators are great for providing high-performance Haskell programs, but they can be even faster if memoization is performed on a finite, discrete domain as an array can then be used.

This package provides various combinators for doing just this, including also combinators for quanitzing and discretizing Float/Double-valued functions.

Example:

import Data.Function.ArrayMemoize

fibA :: Int -> Int
fibA 0 = 1
fibA 1 = 1
fibA n = fibB (n - 1) + fibB (n - 2)

fibB = arrayMemo (0, 1000) fibA 

About

Memoize discrete functions (restricted to a finite domain) using arrays

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published