on master help sign in
cosmetic: change up style of binary serialization code for AST.Kernel
commit6a866cc0a1a9c9695d024272c15a4222cf4a3381 authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 1 Nov 2017, 11:58 (9 years ago) parent32834fa
1 file changed+9−18
src/AST/Kernel.hs+9−18
src/AST/Kernel.hs+9−18
@@ -54,16 +54,16 @@ data Chunk
5454
5555
5656instance Binary Data where
57− put (Data client server) =
58− put client >> put server
57+ put (Data a b) =
58+ put a >> put b
5959
6060 get =
6161 liftM2 Data get get
6262
6363
6464instance Binary Content where
65− put (Content imports chunks) =
66− put imports >> put chunks
65+ put (Content a b) =
66+ put a >> put b
6767
6868 get =
6969 liftM2 Content get get
@@ -72,20 +72,11 @@ instance Binary Content where
7272instance Binary Chunk where
7373 put chunk =
7474 case chunk of
75− JS bytes ->
76− putWord8 0 >> put bytes
77−
78− Var home name ->
79− putWord8 1 >> put home >> put name
80−
81− Field field ->
82− putWord8 2 >> put field
83−
84− Debug ->
85− putWord8 3
86−
87− Prod ->
88− putWord8 4
75+ JS a -> putWord8 0 >> put a
76+ Var a b -> putWord8 1 >> put a >> put b
77+ Field a -> putWord8 2 >> put a
78+ Debug -> putWord8 3
79+ Prod -> putWord8 4
8980
9081 get =
9182 do word <- getWord8