[Haskell-cafe] Memoization in Type Calculation

Dmitry Olshansky olshanskydr at gmail.com
Mon Jul 17 15:19:35 UTC 2017

Hello, cafe!

I wonder is there some possibility to get Memoization in Type Calculation
(e.g. in closed Type Families)?

Can we make something more efficient for famous Fib function then

type family Fib (n::Nat) :: Nat where
  Fib 1 = 1
  Fib 2 = 1
  Fib n = Fib (n-1) + Fib (n-2)

This Fib has obviously exponential calculation time and we need some

If it is impossible right now, maybe there is a ticket for this? It seems
to me very important things, no?

Probably in this case we can write TypeChecker Plugin, but it looks like
the common problem.

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170717/7e56cc04/attachment.html>

More information about the Haskell-Cafe mailing list