packages feed

data-memocombinators 0.2 → 0.3

raw patch · 2 files changed

+12/−2 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Data.MemoCombinators: char :: Memo Char
+ Data.MemoCombinators: wrap :: (a -> b) -> (b -> a) -> Memo a -> Memo b

Files

Data/MemoCombinators.hs view
@@ -28,8 +28,9 @@  module Data.MemoCombinators      ( Memo+    , wrap     , memo2, memo3, memoSecond, memoThird-    , bool, list, boundedList, either, maybe, unit, pair+    , bool, char, list, boundedList, either, maybe, unit, pair     , switch, integral, bits, unsignedBits     , RangeMemo     , arrayRange, unsafeArrayRange, chunks@@ -39,10 +40,16 @@ import Prelude hiding (either, maybe) import Data.Bits import qualified Data.Array as Array+import Data.Char (ord,chr)  -- | The type of a memo table for functions of a. type Memo a = forall r. (a -> r) -> (a -> r) +-- | Given a memoizer for a and an isomorphism between a and b, build+-- a memoizer for b. +wrap :: (a -> b) -> (b -> a) -> Memo a -> Memo b+wrap i j m f = m (f . i) . j+ -- | Memoize a two argument function (just apply the table directly for -- single argument functions). memo2 :: Memo a -> Memo b -> (a -> b -> r) -> (a -> b -> r)@@ -71,6 +78,9 @@     where     table nil cons [] = nil     table nil cons (x:xs) = cons x xs++char :: Memo Char+char = wrap chr ord integral  -- | Build a table which memoizes all lists of less than the given length. boundedList :: Int -> Memo a -> Memo [a]
data-memocombinators.cabal view
@@ -1,7 +1,7 @@ Name: data-memocombinators Description:     Combinators for building memo tables.-Version: 0.2+Version: 0.3 Stability: experimental Synopsis: Combinators for building memo tables. License: BSD3