
3 Sep
2006
3 Sep
'06
1:51 p.m.
On 9/3/06, Julien Oster
Hello, Hi.
Why does the interpreter infer Tracker a a instead of the more general Tracker a c?
The problem is that you're trying to keep a list of all computations performed, and lists can only store values of one uniform type. So, if you have a Tracker storing a list of values of type [a], it must also represent a computation of type a via the second argument, because that's the only type it can append to the list. Thus, unfortunately, you won't be able to implement the general bind operator. To do so, you'd need to have Tracker use a list that can store values of heterogeneous types, which is an entire library unto itself (HList). Hope that helps some, Dan