Dear Leo,
thanks for your proposal, very useful!
And you nicely showed Thorsten's point:
> dimsolve(l,r,var) := [solve(first(l)=first(r),var), subst(var='units,solve(second(l)=second(r),var))];
> dimsolve can be used like so:
> dimsolve([8,m]*v, [10,s], v);
>
> => [[v = 5/4],[units = s/m]]
Units for velocity v should be m/s, not s/m, so you can see that the equation must be wrong. And for students it is helpful to realize this as early as possible.
Best regards,
Michael