@@ -10,14 +10,12 @@ module Cardano.Analysis.API.Ground
10
10
)
11
11
where
12
12
13
- import Prelude (show )
13
+ import Prelude as P (show )
14
14
import Cardano.Prelude hiding (head , toText )
15
15
import Unsafe.Coerce qualified as Unsafe
16
16
17
17
import Data.Aeson
18
18
import Data.Aeson.Types (toJSONKeyText )
19
- import Data.Attoparsec.Text qualified as Atto
20
- import Data.Attoparsec.Time qualified as Iso8601
21
19
import Data.ByteString.Lazy.Char8 qualified as LBS
22
20
import Data.Map.Strict qualified as Map
23
21
import Data.Text qualified as T
@@ -26,7 +24,6 @@ import Data.Text.Short (ShortText, fromText, toText)
26
24
import Data.Time.Clock (UTCTime , NominalDiffTime )
27
25
import Options.Applicative
28
26
import Options.Applicative qualified as Opt
29
- import Quiet (Quiet (.. ))
30
27
import System.FilePath qualified as F
31
28
32
29
import Cardano.Slotting.Slot (EpochNo (.. ), SlotNo (.. ))
@@ -41,13 +38,17 @@ newtype FieldName = FieldName { unFieldName :: Text }
41
38
deriving (Eq , Generic , Ord )
42
39
deriving newtype (FromJSON , IsString , ToJSON )
43
40
deriving anyclass NFData
44
- deriving Show via Quiet FieldName
41
+
42
+ instance Show FieldName where
43
+ show = (" FieldName " ++ ) . P. show . unFieldName
45
44
46
45
newtype TId = TId { unTId :: ShortText }
47
46
deriving (Eq , Generic , Ord )
48
47
deriving newtype (FromJSON , ToJSON )
49
48
deriving anyclass NFData
50
- deriving Show via Quiet TId
49
+
50
+ instance Show TId where
51
+ show = (" TId " ++ ) . P. show . unTId
51
52
52
53
newtype Hash = Hash { unHash :: ShortText }
53
54
deriving (Eq , Generic , Ord )
@@ -95,7 +96,9 @@ newtype Host = Host { unHost :: ShortText }
95
96
deriving (Eq , Generic , Ord )
96
97
deriving newtype (IsString , FromJSON , ToJSON )
97
98
deriving anyclass NFData
98
- deriving Show via Quiet Host
99
+
100
+ instance Show Host where
101
+ show = (" Host " ++ ) . P. show . unHost
99
102
100
103
newtype EpochSlot = EpochSlot { unEpochSlot :: Word64 }
101
104
deriving stock (Eq , Generic , Ord , Show )
@@ -269,26 +272,6 @@ pSlotNo name desc =
269
272
<> Opt. help desc
270
273
)
271
274
272
- optUTCTime :: String -> String -> Parser UTCTime
273
- optUTCTime optname desc =
274
- Opt. option (readerFromAttoParser Iso8601. utcTime)
275
- $ long optname
276
- <> metavar " ISO8601-TIME"
277
- <> help desc
278
- where
279
- -- Stolen from: cardano-cli/src/Cardano/CLI/Shelley/Parsers.hs
280
- readerFromAttoParser :: Atto. Parser a -> Opt. ReadM a
281
- readerFromAttoParser p =
282
- Opt. eitherReader (Atto. parseOnly (p <* Atto. endOfInput) . T. pack)
283
-
284
- optDuration :: String -> String -> NominalDiffTime -> Parser NominalDiffTime
285
- optDuration optname desc def=
286
- Opt. option ((realToFrac :: Double -> NominalDiffTime ) <$> Opt. auto)
287
- $ long optname
288
- <> metavar " SEC"
289
- <> help desc
290
- <> value def
291
-
292
275
optWord :: String -> String -> Word64 -> Parser Word64
293
276
optWord optname desc def =
294
277
Opt. option auto
0 commit comments