Beginner's question: Memo functions in Haskell
Jan Kort
kort@science.uva.nl
Wed, 05 Jun 2002 14:32:38 +0200
Janis Voigtlaender wrote:
>
> It would also seem that one needs to write
>
> fast = memo slow
>
> instead, because otherwise a new memo-version of slow might be created
> for every call with some n (subject to let-floating?).
> However, the version:
>
> module Fib where
>
> import Memo
>
> slow 0 = 0
> slow 1 = 1
> slow n = fast (n-1) + fast (n-2)
>
> fast = memo slow
>
> is not particularly fast easier. Quite in contrary... strange.
>
> Janis.
>
It works under hugs98, but not under ghc5.02.2,
I CC'd the ghc bugs list.
Actually, I was also expecting "fast n = memo slow n"
to work ?
Jan