decodePiece n =
    let
        n' = fromIntegral n - 1
        color = toEnum $ fromIntegral n' `mod` 2
        pType = toEnum $ (n' - (fromEnum color)) `div` 2
    in  Just (ChessPiece pType color)
decodePiece n =
    let
        n' = fromIntegral n - 1
        color = toEnum $ fromIntegral n' `mod` 2
        pType = toEnum $ (n' - (fromEnum color)) `div` 2
    in  Just (ChessPiece pType color)
decodePiece n =
    let
        n' = fromIntegral n - 1
        color = toEnum $ fromIntegral n' `mod` 2
        pType = toEnum $ (n' - (fromEnum color)) `div` 2
    in  Just (ChessPiece pType color)