Thu May 9 07:31:11 EDT 2019


So let's try to get some constraints on abstraction and application.

- When creating a closure, it needs to contain a type marker that
  allows it to be inserted deeper into a loop, but not higher up.  So
  there is a type family of loop nesting as well.

- The arrays that are contained in the context, together with the
  current loop indices will always be valid if we just go deeper.  So
  these can just be tracked.

The index into the type family is the loop nesting.

EDIT: The environment can be encoded as a nested type-level construct
using positional encoding.  Each level contains an array and some
information describint the range of the array.