encodeBoard :: Board -> BStr.ByteString
encodeBoard (Board board) =
    BStr.pack $ map (\ [x,y] ->(shiftL (encodePiece x) 4) .|. encodePiece y) $
    chunksOf 2 $ map (\pos -> Map.lookup pos board  )  positions
encodeBoard :: Board -> BStr.ByteString
encodeBoard (Board board) =
    BStr.pack $ map (\ [x,y] ->(shiftL (encodePiece x) 4) .|. encodePiece y) $
    chunksOf 2 $ map (\pos -> Map.lookup pos board  )  positions
encodeBoard (Board board) =
    BStr.pack $ map (\ [x,y] ->(shiftL (encodePiece x) 4) .|. encodePiece y) $
    chunksOf 2 $ map (\pos -> Map.lookup pos board  )  positions