S.D.Mechveliani wrote:
Remark and question on the ambiguity problem
--------------------------------------------
M.Jones & S.P.Jones paper "...Exploration of Design Space."
E. Meijer is also an author of this paper.
Matrix multiplication:
* :: Matrix a -> Matrix b -> Matrix c
does not satisfy the single-argument restriction, or even
its generalization to an n-argument restriction.
What happens if M1 :: Matrix Int and I type:
M2 = M1 * M1 * M1
I get: Mult (Matrix Int) (Matrix Int) a, Mult a (Matrix Int) b => b
and type-checking fails due to ambiguity. You have to say:
M2 = ((((M1 * M1) :: (Matrix Int)) * M1) :: (Matrix Int))
The point is, for MPTC the "single-argument restriction" is useless for
exactly the applications it should be able to solve.
John Ophel and I have a paper in submission to a journal
that addresses some of these issues. We give an alternative to the
single-argument restriction for MPTC, provide an overload resolution
algorithm, and give some negative decidability results.