on master help sign in
cosmetic: change up style of binary serialization code for AST.Kernel
6a866ccEvan Czaplicki
src/AST/Kernel.hs+9−18
@@ -54,16 +54,16 @@ data Chunk
54
54
55
55
56instance Binary Data where
56instance Binary Data where
57− put (Data client server) =
57+ put (Data a b) =
58− put client >> put server
58+ put a >> put b
59
59
60 get =
60 get =
61 liftM2 Data get get
61 liftM2 Data get get
62
62
63
63
64instance Binary Content where
64instance Binary Content where
65− put (Content imports chunks) =
65+ put (Content a b) =
66− put imports >> put chunks
66+ put a >> put b
67
67
68 get =
68 get =
69 liftM2 Content get get
69 liftM2 Content get get
@@ -72,20 +72,11 @@ instance Binary Content where
72instance Binary Chunk where
72instance Binary Chunk where
73 put chunk =
73 put chunk =
74 case chunk of
74 case chunk of
75− JS bytes ->
76− putWord8 0 >> put bytes
75+ JS a -> putWord8 0 >> put a
77−
78− Var home name ->
79− putWord8 1 >> put home >> put name
76+ Var a b -> putWord8 1 >> put a >> put b
80−
81− Field field ->
82− putWord8 2 >> put field
77+ Field a -> putWord8 2 >> put a
83−
84− Debug ->
85− putWord8 3
78+ Debug -> putWord8 3
86−
87− Prod ->
88− putWord8 4
79+ Prod -> putWord8 4
89
80
90 get =
81 get =
91 do word <- getWord8
82 do word <- getWord8