Tue Jul 12 09:58:19 CEST 2011

Monad data flow analysis

Problem: I'm not used to thinking in monads.  In fact, Bind is still
very counterintuitive to me.

What should bind look like for an operation that updates a data flow
graph?  What I find weird is the appearance of different types a and b
in bind's type signature:

  M a -> (a -> M b) -> M b

Not that much by itself, but in trying to map the "central registry"
idea into an operation that produces this kind of parametetric type.

M a : a value of type `a' with a context

So let's say that M a is actually (Var -> a), a lookup function.
These can be combined as long as it's possible to generate unique
names.  A candidate would be Var = Integer then 

  M a = (Integer, Integer -> a).

What I find strange is that representing this as a function seems to
keep the type under control, but representing it as a "stacked tuple"
lets the type signature grow.  That's a new idea to me.

Something is not right... very uncomfortable feeling of completely
missing the point...