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 memoization.

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,
Dmitry