aboutsummaryrefslogtreecommitdiff
path: root/src/Binary.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Binary.hs')
-rw-r--r--src/Binary.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Binary.hs b/src/Binary.hs
index 07180a8a..2703439a 100644
--- a/src/Binary.hs
+++ b/src/Binary.hs
@@ -474,6 +474,25 @@ instance (Binary a, Binary b, Binary c, Binary d) => Binary (a,b,c,d) where
d <- get bh
return (a,b,c,d)
+instance (Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a,b,c,d,e) where
+ put_ bh (a,b,c,d,e) = do put_ bh a; put_ bh b; put_ bh c; put_ bh d; put_ bh e
+ get bh = do a <- get bh
+ b <- get bh
+ c <- get bh
+ d <- get bh
+ e <- get bh
+ return (a,b,c,d,e)
+
+instance (Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary (a,b,c,d,e,f) where
+ put_ bh (a,b,c,d,e,f) = do put_ bh a; put_ bh b; put_ bh c; put_ bh d; put_ bh e; put_ bh f
+ get bh = do a <- get bh
+ b <- get bh
+ c <- get bh
+ d <- get bh
+ e <- get bh
+ f <- get bh
+ return (a,b,c,d,e,f)
+
instance Binary a => Binary (Maybe a) where
put_ bh Nothing = putByte bh 0
put_ bh (Just a) = do putByte bh 1; put_ bh a