I'm new to Haskell and I've made a very short KenKen solver. Any input is welcome.import Data.Listimport Control.Monadset :: [Int] -> Boolset x = x == nub xmats :: Int -> [[[Int]]]mats x = filter (all set . transpose) . replicateM x $ permutations [1 .. x]doIt :: Int -> [([(Int, Int)], [Int] -> Int, Int)] -> [[Int]]doIt n blocks = join . take 1 . foldl' (flip filter) (mats n) $ map bfun blocksrevSort :: Ord a => [a] -> [a]revSort = sortBy $ flip comparequotient :: [Int] -> Intquotient = foldl1 div . revSortsub :: [Int] -> Intsub = foldl1 (-) . revSortbfun :: ([(Int, Int)], [Int] -> Int, Int) -> [[Int]] -> Boolbfun (locs, opp, res) mat = res == opp (map (\ (x, y) -> mat !! x !! y) locs)sampleBlocs :: [([(Int, Int)], [Int] -> Int, Int)]sampleBlocs = [([(0, 0), (1, 0)], quotient, 2),               ([(0, 1), (1, 1)], sub, 1),               ([(0, 2)], sum, 1),               ([(2, 0), (2, 1)], sub, 2),               ([(1, 2), (2, 2)], product, 6)]sampleBlocs2 :: [([(Int, Int)], [Int] -> Int, Int)]sampleBlocs2 = [([(0, 0), (0, 1)],         sub,      2),                ([(1, 0)],                 sum,      4),                ([(2, 0), (2, 1)],         quotient, 2),                ([(3, 0), (3, 1)],         sub,      1),                ([(0, 2), (1, 1), (1, 2)], product,  8),                ([(2, 2), (3, 2), (3, 3)], sum,      8),                ([(0, 3), (1, 3), (2, 3)], sum,      6)]-- doIt 3 sampleBlocs == [[2,3,1],[1,2,3],[3,1,2]]-- doIt 4 sampleBlocs2 == [[1,3,4,2],[4,1,2,3],[2,4,3,1],[3,2,1,4]]
A short KenKen solver
beginner;haskell;sudoku