Moved memoized to functional.h