Sun Aug 28 14:51:11 CEST 2011

2 x existentials

Throuble is that I have both state as an existential, and the terms in
the environment.  I've used a "show" trick before to avoid knowing the
state type, but it seems to interfere badly with the monad that's used
for the Environment generation.  How to fix?

Why does it have to be a problem?

Well, it is.  stateShow returns M [String].

I have

        (s, i) -> m (s, o)

Where the type of s is not known, but an initial value can be
generated to provide something of type m (s, o) where the s component
still implements stateShow.  The question:

  - how to get s out of the monad, and collect a "compiled" version?

The monad will produce Asm when run, which is Env and (Term t).  This
term is a Variable with some type attached.  But we can't observe the
Term t because we don't know the state.  Will it be possible to return
an Env + (show term)?

What I have now is a bit contrived.  It's probably better to simplify
a bit.

First simplification: does Asm need to have a Term t?  Why not just a
string to accomodate both Var and Res which are multiple vars in a list.

Term t should just be a front for UntypedTerm.