I just wrote a function to move to Tic-Tac-Toe. I wanted to push the pattern. So I wrote 9 makeAMove . Each of them has a Tic-Tac-Toe board with a different space, indicated by a blank symbol. It looks something like this.
makeAMove [[E, m12, m13], [m21, m22, m23], [m31, m32, m33]] X 1 1 = ...
At this point, X will be placed in the upper left corner of the board. X, O, and E are defined as labels.
data Mark = X | O | E deriving (Eq, Show)
When I upload a file, I get this warning.
warning: Pattern match checker exceeded (2000000) iterations in an equation for 'mov1'. (Use -fmax-pmcheck-iterations=n to set the maximun number of iterations to n)
My question is one of curiosity. What kind of iteration does the template perform? And why is so much required?
When I limit the number of sentences to, say, 5, and the rest is in another function related to the default case, there is no problem.
pattern-matching haskell ghc
RussAbbott
source share