Mon May 20 06:40:52 EDT 2019

A monadic test language

p a b = do
  c <- op [a,b]
  d <- op [a,c]
  return [d]
Currently there is nothing to represent return, which I knew already.

The most appropriate structure is the state continuation monad.  Maybe
this time, write it as a transformer?

The question is then, what is the order of transformation?

Alright... Because of the lack of nesting in the previous Seq and PRU
languages, I've been able to avoid this one.  I don't remember how it
works, or where I have the code parked...

I found something here:



Let's just copy the latter.

EDIT: Added Functor and Applicative instances, and created a basic
'op' primitive.  Because this needs allocation, it's time to move from
String to Int-indexed variables.

Ok I remember: CPS is used just to be able to do the state threading.
State is just variable count.