putBinaryValue :: UVec.Unbox a =>
                  String -> Vector Int -> Vector a -> (a -> Put) -> Put
putBinaryValue tstr shape vs putv = do
  putInt8 $ fromIntegral $ ord 'b'
  putWord8 binaryFormatVersion
  putWord8 $ fromIntegral $ UVec.length shape
  mapM_ (putInt8 . fromIntegral . ord) tstr
  mapM_ (putInt64le . fromIntegral) $ UVec.toList shape
  mapM_ putv $ UVec.toList vs
putBinaryValue :: UVec.Unbox a =>
                  String -> Vector Int -> Vector a -> (a -> Put) -> Put
putBinaryValue tstr shape vs putv = do
  putInt8 $ fromIntegral $ ord 'b'
  putWord8 binaryFormatVersion
  putWord8 $ fromIntegral $ UVec.length shape
  mapM_ (putInt8 . fromIntegral . ord) tstr
  mapM_ (putInt64le . fromIntegral) $ UVec.toList shape
  mapM_ putv $ UVec.toList vs
putBinaryValue tstr shape vs putv = do
  putInt8 $ fromIntegral $ ord 'b'
  putWord8 binaryFormatVersion
  putWord8 $ fromIntegral $ UVec.length shape
  mapM_ (putInt8 . fromIntegral . ord) tstr
  mapM_ (putInt64le . fromIntegral) $ UVec.toList shape
  mapM_ putv $ UVec.toList vs