xorAndCirc :: Gate g => Int -> Circuit g
xorAndCirc n = buildCircuit $ do
    cs <- safeChunksOf (div n 2) <$> symbol n
    output =<< circProd =<< zipWithM circXor (cs !! 0) (cs !! 1)
xorAndCirc :: Gate g => Int -> Circuit g
xorAndCirc n = buildCircuit $ do
    cs <- safeChunksOf (div n 2) <$> symbol n
    output =<< circProd =<< zipWithM circXor (cs !! 0) (cs !! 1)
xorAndCirc n = buildCircuit $ do
    cs <- safeChunksOf (div n 2) <$> symbol n
    output =<< circProd =<< zipWithM circXor (cs !! 0) (cs !! 1)