The array-memoize package

[Tags:bsd3, library]

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 since an array can then be used to store results.

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

Example:

fib' :: (Int -> Int) -> Int -> Int
fib' _ 0 = 1
fib' _ 1 = 1
fib' rec n = rec (n - 1) + rec (n - 2)
fib :: Int -> Int
fib = arrayMemoFix (0, 1000) fib'

Properties

Versions 0.5.0, 0.6.0
Dependencies array (>=0.4), base (<5) [details]
License BSD3
Copyright Dominic Orchard, 2014
Author Dominic Orchard
Maintainer Dominic Orchard
Category Syntax,
Source repository head: git clone https://github.com/dorchard/array-memoize
Uploaded Fri Apr 4 15:58:23 UTC 2014 by DominicOrchard
Distributions LTSHaskell:0.6.0, NixOS:0.6.0, Stackage:0.6.0, Tumbleweed:0.6.0
Downloads 690 total (41 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Successful builds reported [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees