Van Snyder (= [EMAIL PROTECTED]) asks why the following definition
doesn't work:

|  q :: (Integral d) => Array d (Array d d)
|  q = array (1,2) [1 := array (1,3) [j := j | j <- [1..3]]] ++
|                  [2 := q!1]

The reason is that it is missing some parentheses.  Using the rule
that function application always binds tighter than any infix operator,
the right hand side of the definition is parsed as:

 (array (1,2) [1 := array (1,3) [j := j | j <- [1..3]]]) ++ [2 := q!1]

But then the first argument to ++ is an array, not a list, so this is a
type error.  Writing parens around the two lists should solve the
problem:

  q = array (1,2) ([1 := array (1,3) [j := j | j <- [1..3]]] ++
                   [2 := q!1])

Hope that helps!
Mark

Reply via email to