One other small thing: I think the functions should take arguments in the order (T, A) instead of (A, T). It doesn't matter too much, but when I see "with", I assume that will be a second argument that will be passed along, so I think that order would make more sense.