@@ -3,6 +3,11 @@ module Reporting.Region where
33
44import Data.Aeson ((.=))
55import qualified Data.Aeson as Json
6+import Data.Binary
7+
8+
9+
10+-- REGION
611
712
813data Region =
@@ -60,3 +65,25 @@ instance Json.ToJSON Position where
6065 [ "line" .= line
6166 , "column" .= column
6267 ]
68+
69+
70+
71+-- BINARY
72+
73+
74+instance Binary Region where
75+ get =
76+ Region <$> get <*> get
77+
78+ put (Region start end) =
79+ do put start
80+ put end
81+
82+
83+instance Binary Position where
84+ get =
85+ Position <$> get <*> get
86+
87+ put (Position line column) =
88+ do put line
89+ put column