From 5572dbc8289de934e9ee5bc3f74a0f98365ce3e5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 21 Apr 2017 17:42:10 -0400 Subject: initial http server Incomplete, but the client is able to connect and send messages which get logged. Split up debug-me.hs into Role/* Switched from cereal to binary, since websockets operate on lazy ByteStrings, and using cereal would involve a copy on every receive. This commit was sponsored by Boyd Stephen Smith Jr. on Patreon. --- Types.hs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'Types.hs') diff --git a/Types.hs b/Types.hs index 699fa59..b28713d 100644 --- a/Types.hs +++ b/Types.hs @@ -2,7 +2,7 @@ {- | Main types for debug-me - - - Note that changing types in ways that change the cereal serialization + - Note that changing types in ways that change the Binary serialization - changes debug-me's wire format. Changing types in ways that change the - aeson serialization changes debug-me's log format. -} @@ -136,56 +136,56 @@ newtype GpgSig = GpgSig Val instance DataSize GpgSig where dataSize (GpgSig s) = dataSize s -instance Serialize Seen +instance Binary Seen instance ToJSON Seen instance FromJSON Seen -instance Serialize Entered +instance Binary Entered instance ToJSON Entered instance FromJSON Entered -instance Serialize (Activity Seen) +instance Binary (Activity Seen) instance ToJSON (Activity Seen) instance FromJSON (Activity Seen) -instance Serialize (Activity Entered) +instance Binary (Activity Entered) instance ToJSON (Activity Entered) instance FromJSON (Activity Entered) -instance Serialize Control +instance Binary Control instance ToJSON Control instance FromJSON Control -instance Serialize Hash +instance Binary Hash instance ToJSON Hash instance FromJSON Hash -instance Serialize HashMethod +instance Binary HashMethod instance ToJSON HashMethod instance FromJSON HashMethod -instance Serialize PublicKey +instance Binary PublicKey instance ToJSON PublicKey instance FromJSON PublicKey -instance Serialize GpgSig +instance Binary GpgSig instance ToJSON GpgSig instance FromJSON GpgSig -instance Serialize (Message Seen) +instance Binary (Message Seen) instance ToJSON (Message Seen) where toJSON = genericToJSON sumOptions toEncoding = genericToEncoding sumOptions instance FromJSON (Message Seen) where parseJSON = genericParseJSON sumOptions -instance Serialize (Message Entered) +instance Binary (Message Entered) instance ToJSON (Message Entered) where toJSON = genericToJSON sumOptions toEncoding = genericToEncoding sumOptions instance FromJSON (Message Entered) where parseJSON = genericParseJSON sumOptions -instance Serialize Signature +instance Binary Signature instance ToJSON Signature where toJSON = genericToJSON sumOptions toEncoding = genericToEncoding sumOptions instance FromJSON Signature where parseJSON = genericParseJSON sumOptions -instance Serialize ControlAction +instance Binary ControlAction instance ToJSON ControlAction where toJSON = genericToJSON sumOptions toEncoding = genericToEncoding sumOptions -- cgit v1.2.3