@@ -9,9 +9,10 @@ module Kore.JsonRpc.Types.ContextLog (
9
9
) where
10
10
11
11
import Data.Aeson.TH (deriveJSON )
12
- import Data.Aeson.Types (FromJSON (.. ), Options ( .. ), ToJSON (.. ), defaultOptions )
12
+ import Data.Aeson.Types (FromJSON (.. ), ToJSON (.. ), defaultOptions )
13
13
import Data.Aeson.Types qualified as JSON
14
14
import Data.Char (toLower )
15
+ import Data.Data (Data , toConstr )
15
16
import Data.Sequence (Seq )
16
17
import Data.Text (Text , unpack )
17
18
import Data.Text qualified as Text
@@ -51,7 +52,10 @@ data SimpleContext
51
52
CtxError
52
53
| CtxWarn
53
54
| CtxInfo
54
- deriving stock (Show , Eq , Ord , Enum )
55
+ deriving stock (Eq , Ord , Enum , Data )
56
+
57
+ instance Show SimpleContext where
58
+ show = JSON. camelTo2 ' -' . drop 3 . show . toConstr
55
59
56
60
$ ( deriveJSON
57
61
defaultOptions
@@ -127,7 +131,7 @@ data CLContext
127
131
deriving stock (Eq )
128
132
129
133
instance Show CLContext where
130
- show (CLNullary c) = map toLower . drop 3 $ show c
134
+ show (CLNullary c) = show c
131
135
show (CLWithId withId) = show withId
132
136
133
137
instance ToJSON CLContext where
0 commit comments