Here is my code
quadtreeToPic QNode x y w avg Q4(q1 q2 q3 q4) = array ((0,0) (w-1,w-1)) (concat (map quadtreeToPic [q1, q2, q3, q4]))
Basically, a Quadtree is x y w avg QChildren where QChildren is qither Q0 or Q4 Quadtree Quadtree Quadtree Quadtree.
When I do what I tried above, I get this error
Quadtree.hs:13:34: error: Parse error in pattern: q1
|
13 | quadtreeToPic QNode x y w avg Q4(q1 q2 q3 q4) = array ((0,0) (w-1,w-1)) (concat (map quadtreeToPic [q1, q2, q3, q4]))
| ^^^^^^^^^^^
Why is this?
Q4data constructor, soquadtreeToPic QNode x y w avg (Q4 q1 q2 q3 q4) = ...