Sun Aug 21 15:47:57 CEST 2011
According to Felipe there is a way around the problem by using
Data.Typeable. I still need to read again to make sure I get it
The idea is to move some of the type checking to run-time. Of course
this makes it possible to have run-time errors or "default behaviour"
when the types do not match.
Maybe it's possible to enforce well-behavedness using some other
The bad behaviour seems to come from control flow, i.e. pattern
matching (case) or if .. then .. else. Assuming this is the case then
one can say this works "if the user doesn't use control flow". I'm
not so sure this is a good idea.
It's a Monad, except when it's not. And you'll find out when you
run the program.
I think I'm sticking to Arrow unless I get a non-dynamic solution.
It's a nice trick to know though.
TODO: read again, test it and reply.