added a simple length example
using a simple cache instead of scalaz memoization to store metadata