To remove some of the duplication from checkWin and checkMacrowin:
Have a function that takes [Bool] and returns True if there's a row of 3 trues, then use checkWin [p == Just X | p <- board] and checkWin [snd mb == Won X | mb <- bigboard]
Or, return a list of which (mini/macro) squares X has "won", and use a function to check if any of the winning location combinations is a subset. i.e. [1,2,3] subset [ind | (ind,p) <- zip [1..] board, p == Just X]
https://github.com/TU-CSCI2322-FL22/solver-connect-three/blob/3b398642bada87d610c043c993389cc52d8ec5ec/Main.hs#L20
To remove some of the duplication from checkWin and checkMacrowin:
[Bool]
and returns True if there's a row of 3 trues, then usecheckWin [p == Just X | p <- board]
andcheckWin [snd mb == Won X | mb <- bigboard]
[1,2,3] subset [ind | (ind,p) <- zip [1..] board, p == Just X]