-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add new group chats savedata support.
- Loading branch information
Showing
16 changed files
with
357 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
\subsection{Bytes} | ||
|
||
Arbitrary byte array. | ||
|
||
\begin{code} | ||
{-# LANGUAGE DeriveGeneric #-} | ||
{-# LANGUAGE StrictData #-} | ||
module Network.Tox.SaveData.Bytes | ||
( Bytes (..) | ||
) where | ||
import Data.Binary (Binary (..)) | ||
import Data.Binary.Get (Get) | ||
import qualified Data.Binary.Get as Get | ||
import Data.Binary.Put (Put) | ||
import qualified Data.Binary.Put as Put | ||
import qualified Data.ByteString.Lazy as LBS | ||
import Data.MessagePack (MessagePack) | ||
import GHC.Generics (Generic) | ||
import Test.QuickCheck.Arbitrary (Arbitrary (..)) | ||
newtype Bytes = Bytes LBS.ByteString | ||
deriving (Eq, Show, Read, Generic) | ||
instance MessagePack Bytes | ||
instance Binary Bytes where | ||
get = Bytes <$> Get.getRemainingLazyByteString | ||
put (Bytes bs) = Put.putLazyByteString bs | ||
instance Arbitrary Bytes where | ||
arbitrary = Bytes . LBS.pack <$> arbitrary | ||
\end{code} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.