Skip to content

Commit ade88fb

Browse files
committed
Move Density and Wrapped to the type level
1 parent 224f8aa commit ade88fb

File tree

13 files changed

+91
-88
lines changed

13 files changed

+91
-88
lines changed

eras/allegra/impl/src/Cardano/Ledger/Allegra/Scripts.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,13 @@ invalidBeforeL = lens invalidBefore (\vi before -> vi {invalidBefore = before})
130130
invalidHereAfterL :: Lens' ValidityInterval (StrictMaybe SlotNo)
131131
invalidHereAfterL = lens invalidHereafter (\vi hereAfter -> vi {invalidHereafter = hereAfter})
132132

133-
encodeVI :: ValidityInterval -> Encode ('Closed 'Dense) ValidityInterval
133+
encodeVI :: ValidityInterval -> Encode (Closed Dense) ValidityInterval
134134
encodeVI (ValidityInterval f t) = Rec ValidityInterval !> To f !> To t
135135

136136
instance EncCBOR ValidityInterval where
137137
encCBOR vi = encode (encodeVI vi)
138138

139-
decodeVI :: Decode ('Closed 'Dense) ValidityInterval
139+
decodeVI :: Decode (Closed Dense) ValidityInterval
140140
decodeVI = RecD ValidityInterval <! From <! From
141141

142142
instance DecCBOR ValidityInterval where
@@ -213,7 +213,7 @@ instance Era era => EncCBOR (TimelockRaw era) where
213213
instance Era era => DecCBOR (Annotator (TimelockRaw era)) where
214214
decCBOR = decode (Summands "TimelockRaw" decRaw)
215215
where
216-
decRaw :: Word -> Decode 'Open (Annotator (TimelockRaw era))
216+
decRaw :: Word -> Decode Open (Annotator (TimelockRaw era))
217217
decRaw 0 = Ann (SumD TimelockSignature <! From)
218218
decRaw 1 = Ann (SumD TimelockAllOf) <*! D (sequence <$> decCBOR)
219219
decRaw 2 = Ann (SumD TimelockAnyOf) <*! D (sequence <$> decCBOR)

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Rules/Utxo.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ encFail ::
621621
, EncCBOR (PredicateFailure (EraRule "UTXOS" era))
622622
) =>
623623
AlonzoUtxoPredFailure era ->
624-
Encode 'Open (AlonzoUtxoPredFailure era)
624+
Encode Open (AlonzoUtxoPredFailure era)
625625
encFail (BadInputsUTxO ins) =
626626
Sum (BadInputsUTxO @era) 0 !> To ins
627627
encFail (OutsideValidityIntervalUTxO a b) =
@@ -670,7 +670,7 @@ decFail ::
670670
, DecCBOR (PredicateFailure (EraRule "UTXOS" era))
671671
) =>
672672
Word ->
673-
Decode 'Open (AlonzoUtxoPredFailure era)
673+
Decode Open (AlonzoUtxoPredFailure era)
674674
decFail 0 = SumD BadInputsUTxO <! From
675675
decFail 1 = SumD OutsideValidityIntervalUTxO <! From <! From
676676
decFail 2 = SumD MaxTxSizeUTxO <! From

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/Scripts.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ instance AlonzoEraScript era => EncCBOR (AlonzoScript era)
604604
instance AlonzoEraScript era => ToCBOR (AlonzoScript era) where
605605
toCBOR = toEraCBOR @era . encode . encodeScript
606606

607-
encodeScript :: AlonzoEraScript era => AlonzoScript era -> Encode 'Open (AlonzoScript era)
607+
encodeScript :: AlonzoEraScript era => AlonzoScript era -> Encode Open (AlonzoScript era)
608608
encodeScript = \case
609609
NativeScript i -> Sum NativeScript 0 !> To i
610610
PlutusScript plutusScript -> withPlutusScript plutusScript $ \plutus@(Plutus pb) ->
@@ -620,7 +620,7 @@ instance AlonzoEraScript era => DecCBOR (Annotator (AlonzoScript era)) where
620620
decodeAnnPlutus slang =
621621
Ann (SumD PlutusScript) <*! Ann (D (decodePlutusScript slang))
622622
{-# INLINE decodeAnnPlutus #-}
623-
decodeScript :: Word -> Decode 'Open (Annotator (AlonzoScript era))
623+
decodeScript :: Word -> Decode Open (Annotator (AlonzoScript era))
624624
decodeScript = \case
625625
0 -> Ann (SumD NativeScript) <*! From
626626
1 -> decodeAnnPlutus SPlutusV1

eras/alonzo/impl/src/Cardano/Ledger/Alonzo/TxWits.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ instance AlonzoEraScript era => EncCBOR (AlonzoTxWitsRaw era) where
502502
encodePlutus ::
503503
PlutusLanguage l =>
504504
SLanguage l ->
505-
Encode ('Closed 'Dense) (Map.Map ScriptHash (Plutus l))
505+
Encode (Closed Dense) (Map.Map ScriptHash (Plutus l))
506506
encodePlutus slang =
507507
E
508508
(encodeWithSetTag . encCBOR . map plutusBinary . Map.elems)
@@ -651,7 +651,7 @@ addScriptsTxWitsRaw scriptWitnesses txWits =
651651
decodeAlonzoPlutusScript ::
652652
(AlonzoEraScript era, PlutusLanguage l) =>
653653
SLanguage l ->
654-
Decode ('Closed 'Dense) (Map ScriptHash (Script era))
654+
Decode (Closed Dense) (Map ScriptHash (Script era))
655655
decodeAlonzoPlutusScript slang =
656656
D $
657657
ifDecoderVersionAtLeast

eras/conway/impl/src/Cardano/Ledger/Conway/TxBody.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ pattern ConwayTxBody
589589

590590
encodeTxBodyRaw ::
591591
ConwayTxBodyRaw l ConwayEra ->
592-
Encode ('Closed 'Sparse) (ConwayTxBodyRaw l ConwayEra)
592+
Encode (Closed Sparse) (ConwayTxBodyRaw l ConwayEra)
593593
encodeTxBodyRaw ConwayTxBodyRaw {..} =
594594
let ValidityInterval bot top = ctbrVldt
595595
in Keyed

eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/Scripts.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ instance Era era => EncCBOR (DijkstraNativeScriptRaw era) where
243243
instance Era era => DecCBOR (Annotator (DijkstraNativeScriptRaw era)) where
244244
decCBOR = decode (Summands "DijkstraNativeScriptRaw" decRaw)
245245
where
246-
decRaw :: Word -> Decode 'Open (Annotator (DijkstraNativeScriptRaw era))
246+
decRaw :: Word -> Decode Open (Annotator (DijkstraNativeScriptRaw era))
247247
decRaw 0 = Ann (SumD DijkstraRequireSignature <! From)
248248
decRaw 1 = Ann (SumD DijkstraRequireAllOf) <*! D (sequence <$> decCBOR)
249249
decRaw 2 = Ann (SumD DijkstraRequireAnyOf) <*! D (sequence <$> decCBOR)

eras/dijkstra/impl/src/Cardano/Ledger/Dijkstra/TxBody.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ instance (Typeable l, EraTxBody era) => DecCBOR (DijkstraTxBodyRaw l era) where
381381

382382
encodeTxBodyRaw ::
383383
(EraTxBody era, EncCBOR (Tx SubTx era)) =>
384-
DijkstraTxBodyRaw l era -> Encode ('Closed 'Sparse) (DijkstraTxBodyRaw l era)
384+
DijkstraTxBodyRaw l era -> Encode (Closed Sparse) (DijkstraTxBodyRaw l era)
385385
encodeTxBodyRaw DijkstraTxBodyRaw {..} =
386386
let ValidityInterval bot top = dtbrVldt
387387
in Keyed

eras/shelley/impl/src/Cardano/Ledger/Shelley/TxBody.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ boxBody n = invalidField n
167167
-- The key order looks strange but was choosen for backward compatibility.
168168
txSparse ::
169169
EraTxBody era =>
170-
ShelleyTxBodyRaw t era -> Encode ('Closed 'Sparse) (ShelleyTxBodyRaw t era)
170+
ShelleyTxBodyRaw t era -> Encode (Closed Sparse) (ShelleyTxBodyRaw t era)
171171
txSparse (ShelleyTxBodyRaw input output cert wdrl fee ttl update hash) =
172172
Keyed (\i o f t c w u h -> ShelleyTxBodyRaw i o c w f t u h)
173173
!> Key 0 (To input) -- We don't have to send these in ShelleyTxBodyRaw order

libs/cardano-ledger-binary/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## 1.8.0.0
44

5+
* Change `Density` type to only be available at the type level
6+
* Change `Wrapped` type to only be available at the type level
57
* Make `decodeAnnSet` fail when there are duplicates, starting with protocol version `12`.
68
* Provide ability for `Annotator` to fail, by changing its type signature to return `Either` and adding `MonadFail` instance.
79
* Remove `encodedSizeExpr` and `encodedListSizeExpr` from `EncCBOR`

libs/cardano-ledger-binary/src/Cardano/Ledger/Binary/Decoding/Coders.hs

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
{-# LANGUAGE ScopedTypeVariables #-}
1212
{-# LANGUAGE TupleSections #-}
1313
{-# LANGUAGE TypeApplications #-}
14+
{-# LANGUAGE TypeData #-}
1415
{-# LANGUAGE TypeFamilies #-}
1516

1617
module Cardano.Ledger.Binary.Decoding.Coders (
@@ -117,20 +118,20 @@ import Data.Void (Void)
117118
-- fields). We use indexes to types to try and mark (and enforce) these distinctions.
118119

119120
-- | Index for record density. Distinguishing (all the fields) from (some of the fields).
120-
data Density = Dense | Sparse
121+
type data Density = Dense | Sparse
121122

122-
-- | Index for a wrapped Coder. Wrapping is necessary for 'Summands' and 'SparseKeyed'.
123-
data Wrapped where
123+
-- | Index for a wrapped Coder. Wrapping is necessary for 'Summands' and SparseKeyed'.
124+
type data Wrapped where
124125
Open :: Wrapped -- Needs some type-wide wrapping
125126
Closed :: Density -> Wrapped -- Does not need type-wide wrapping,
126-
-- But may need field-wide wrapping, when Density is 'Sparse
127+
-- But may need field-wide wrapping, when Density is Sparse
127128

128129
-- | A Field pairs an update function and a decoder for one field of a Sparse record.
129130
data Field t where
130131
Field :: (x -> t -> t) -> (forall s. Decoder s x) -> Field t
131132

132133
{-# INLINE field #-}
133-
field :: Typeable x => (x -> t -> t) -> Decode ('Closed d) x -> Field t
134+
field :: Typeable x => (x -> t -> t) -> Decode (Closed d) x -> Field t
134135
field update dec = Field update (decode dec)
135136

136137
{-# INLINE fieldGuarded #-}
@@ -141,7 +142,7 @@ fieldGuarded ::
141142
-- | The condition to guard against
142143
(x -> Bool) ->
143144
(x -> t -> t) ->
144-
Decode ('Closed d) x ->
145+
Decode (Closed d) x ->
145146
Field t
146147
fieldGuarded failMsg check update dec =
147148
Field
@@ -151,7 +152,7 @@ fieldGuarded failMsg check update dec =
151152
)
152153

153154
{-# INLINE ofield #-}
154-
ofield :: Typeable x => (StrictMaybe x -> t -> t) -> Decode ('Closed d) x -> Field t
155+
ofield :: Typeable x => (StrictMaybe x -> t -> t) -> Decode (Closed d) x -> Field t
155156
ofield update dec = Field update (SJust <$> decode dec)
156157

157158
{-# INLINE invalidField #-}
@@ -160,15 +161,15 @@ invalidField n = field (flip $ const @t @Void) (Invalid n)
160161

161162
-- | Sparse decode something with a (DecCBOR (Annotator t)) instance
162163
-- A special case of 'field'
163-
fieldA :: (Typeable x, Applicative ann) => (x -> t -> t) -> Decode ('Closed d) x -> Field (ann t)
164+
fieldA :: (Typeable x, Applicative ann) => (x -> t -> t) -> Decode (Closed d) x -> Field (ann t)
164165
fieldA update dec = Field (liftA2 update) (pure <$> decode dec)
165166
{-# INLINE fieldA #-}
166167

167168
-- | Sparse decode something with a (DecCBOR (Annotator t)) instance
168169
fieldAA ::
169170
(Typeable x, Typeable ann, Applicative ann) =>
170171
(x -> t -> t) ->
171-
Decode ('Closed d) (ann x) ->
172+
Decode (Closed d) (ann x) ->
172173
Field (ann t)
173174
fieldAA update dec = Field (liftA2 update) (decode dec)
174175
{-# INLINE fieldAA #-}
@@ -197,10 +198,10 @@ fieldAA update dec = Field (liftA2 update) (decode dec)
197198
--
198199
-- data A = ACon Int B C
199200
--
200-
-- encodeA :: A -> Encode ('Closed 'Dense) A
201+
-- encodeA :: A -> Encode (Closed Dense) A
201202
-- encodeA (ACon i b c) = Rec ACon !> To i !> E (encCBOR . unB) b !> To c
202203
--
203-
-- decodeA :: Decode ('Closed 'Dense) A
204+
-- decodeA :: Decode (Closed Dense) A
204205
-- decodeA = RecD ACon <! From <! D (B <$> decCBOR) <! From
205206
--
206207
-- instance EncCBOR A where
@@ -214,13 +215,13 @@ fieldAA update dec = Field (liftA2 update) (decode dec)
214215
-- @
215216
-- data N = N1 Int | N2 B Bool | N3 A
216217
--
217-
-- encodeN :: N -> Encode 'Open N
218+
-- encodeN :: N -> Encode Open N
218219
-- encodeN (N1 i) = Sum N1 0 !> To i
219220
-- encodeN (N2 b tf) = Sum N2 1 !> E (encCBOR . unB) b !> To tf
220221
-- encodeN (N3 a) = Sum N3 2 !> To a
221222
--
222-
-- decodeN :: Decode ('Closed 'Dense) N -- Note each clause has an 'Open decoder,
223-
-- decodeN = Summands "N" decodeNx -- But Summands returns a ('Closed 'Dense) decoder
223+
-- decodeN :: Decode (Closed Dense) N -- Note each clause has an Open decoder,
224+
-- decodeN = Summands "N" decodeNx -- But Summands returns a (Closed Dense) decoder
224225
-- where decodeNx 0 = SumD N1 <! From
225226
-- decodeNx 1 = SumD N2 <! D (B <$> decCBOR) <! From
226227
-- decodeNx 3 = SumD N3 <! From
@@ -253,13 +254,13 @@ fieldAA update dec = Field (liftA2 update) (decode dec)
253254
-- encoding some of the values. Note the use of 'Sum' with virtual constructor tags 0,1,2,3
254255
--
255256
-- @
256-
-- encM :: M -> Encode 'Open M
257+
-- encM :: M -> Encode Open M
257258
-- encM (M 0 [] t) = Sum M 0 !> OmitC 0 !> OmitC [] !> To t
258259
-- encM (M 0 bs t) = Sum M 1 !> OmitC 0 !> To bs !> To t
259260
-- encM (M n [] t) = Sum M 2 !> To n !> OmitC [] !> To t
260261
-- encM (M n bs t) = Sum M 3 !> To n !> To bs !> To t
261262
--
262-
-- decM :: Word -> Decode 'Open M
263+
-- decM :: Word -> Decode Open M
263264
-- decM 0 = SumD M <! Emit 0 <! Emit [] <! From -- The virtual constructors tell which fields have been Omited
264265
-- decM 1 = SumD M <! Emit 0 <! From <! From -- So those fields are reconstructed using 'Emit'.
265266
-- decM 2 = SumD M <! From <! Emit [] <! From
@@ -287,7 +288,7 @@ fieldAA update dec = Field (liftA2 update) (decode dec)
287288
-- The user must ensure that there is NOT an Omit on a required field. 'encM2' is an example.
288289
--
289290
-- @
290-
-- encM2:: M -> Encode ('Closed 'Sparse) M
291+
-- encM2:: M -> Encode (Closed Sparse) M
291292
-- encM2 (M n xs t) =
292293
-- Keyed M
293294
-- !> Omit (== 0) (Key 0 (To n)) -- Omit if n is zero
@@ -337,11 +338,11 @@ fieldAA update dec = Field (liftA2 update) (decode dec)
337338
-- @
338339
data Decode (w :: Wrapped) t where
339340
-- | Label the constructor of a Record-like datatype (one with exactly 1 constructor) as a Decode.
340-
RecD :: t -> Decode ('Closed 'Dense) t
341+
RecD :: t -> Decode (Closed Dense) t
341342
-- | Label the constructor of a Record-like datatype (one with multiple constructors) as an Decode.
342-
SumD :: t -> Decode 'Open t
343+
SumD :: t -> Decode Open t
343344
-- | Lift a Word to Decode function into a DeCode for a type with multiple constructors.
344-
Summands :: Text.Text -> (Word -> Decode 'Open t) -> Decode ('Closed 'Dense) t
345+
Summands :: Text.Text -> (Word -> Decode Open t) -> Decode (Closed Dense) t
345346
-- | Lift a Word to Field function into a DeCode for a type with 1 constructor stored sparsely
346347
SparseKeyed ::
347348
Typeable t =>
@@ -353,28 +354,28 @@ data Decode (w :: Wrapped) t where
353354
(Word -> Field t) ->
354355
-- | Pairs of keys and Strings which must be there (default values not allowed)
355356
[(Word, String)] ->
356-
Decode ('Closed 'Dense) t
357+
Decode (Closed Dense) t
357358
-- | Label a (component, field, argument) as sparsely stored, which will be populated
358359
-- with the default value.
359-
KeyedD :: t -> Decode ('Closed 'Sparse) t
360+
KeyedD :: t -> Decode (Closed Sparse) t
360361
-- | Label a (component, field, argument). It will be decoded using the existing
361362
-- DecCBOR instance at @t@
362363
From :: DecCBOR t => Decode w t
363364
-- | Label components, fields, arguments. It will be decoded using the existing
364365
-- DecCBORGroup instance at @t@
365366
FromGroup :: (EncCBORGroup t, DecCBORGroup t) => Decode w t
366367
-- | Label a (component, field, argument). It will be decoded using the given decoder.
367-
D :: (forall s. Decoder s t) -> Decode ('Closed 'Dense) t
368+
D :: (forall s. Decoder s t) -> Decode (Closed Dense) t
368369
-- | Apply a functional decoding (arising from 'RecD' or 'SumD') to get (type wise)
369370
-- smaller decoding.
370-
ApplyD :: Typeable a => Decode w1 (a -> t) -> Decode ('Closed d) a -> Decode w1 t
371+
ApplyD :: Typeable a => Decode w1 (a -> t) -> Decode (Closed d) a -> Decode w1 t
371372
-- | Mark a Word as a Decoding which is not a valid Decoding. Used when decoding sums
372373
-- that are tagged out of range.
373374
Invalid :: Word -> Decode w t
374375
-- | Used to make (Decode w) an instance of Functor.
375376
Map :: Typeable a => (a -> b) -> Decode w a -> Decode w b
376377
-- | Assert that the next thing decoded must be tagged with the given word.
377-
TagD :: Word -> Decode ('Closed x) t -> Decode ('Closed x) t
378+
TagD :: Word -> Decode (Closed x) t -> Decode (Closed x) t
378379
-- | Decode the next thing, not by inspecting the bytes, but pulled out of thin air,
379380
-- returning @t@. Used in sparse decoding.
380381
Emit :: t -> Decode w t
@@ -391,10 +392,10 @@ data Decode (w :: Wrapped) t where
391392
-- | A functional Decode
392393
Decode w1 (Annotator (a -> t)) ->
393394
-- | An Decoder for an Annotator
394-
Decode ('Closed d) (Annotator a) ->
395+
Decode (Closed d) (Annotator a) ->
395396
Decode w1 (Annotator t)
396397
-- | the function to Either can raise an error when applied by returning (Left errorMessage)
397-
ApplyErr :: Typeable a => Decode w1 (a -> Either String t) -> Decode ('Closed d) a -> Decode w1 t
398+
ApplyErr :: Typeable a => Decode w1 (a -> Either String t) -> Decode (Closed d) a -> Decode w1 t
398399

399400
infixl 4 <!
400401

@@ -403,19 +404,19 @@ infixl 4 <*!
403404
infixl 4 <?
404405

405406
-- | Infix form of @ApplyD@ with the same infixity and precedence as @($)@.
406-
(<!) :: Typeable a => Decode w1 (a -> t) -> Decode ('Closed w) a -> Decode w1 t
407+
(<!) :: Typeable a => Decode w1 (a -> t) -> Decode (Closed w) a -> Decode w1 t
407408
x <! y = ApplyD x y
408409
{-# INLINE (<!) #-}
409410

410411
-- | Infix form of @ApplyAnn@ with the same infixity and precedence as @($)@.
411412
(<*!) ::
412413
(Typeable a, Typeable t) =>
413-
Decode w1 (Annotator (a -> t)) -> Decode ('Closed d) (Annotator a) -> Decode w1 (Annotator t)
414+
Decode w1 (Annotator (a -> t)) -> Decode (Closed d) (Annotator a) -> Decode w1 (Annotator t)
414415
x <*! y = ApplyAnn x y
415416
{-# INLINE (<*!) #-}
416417

417418
-- | Infix form of @ApplyErr@ with the same infixity and precedence as @($)@.
418-
(<?) :: Typeable a => Decode w1 (a -> Either String t) -> Decode ('Closed d) a -> Decode w1 t
419+
(<?) :: Typeable a => Decode w1 (a -> Either String t) -> Decode (Closed d) a -> Decode w1 t
419420
f <? y = ApplyErr f y
420421
{-# INLINE (<?) #-}
421422

@@ -481,7 +482,7 @@ decodeCount (ApplyErr cn g) n = do
481482

482483
-- The type of DecodeClosed precludes pattern match against (SumD c) as the types are different.
483484

484-
decodeClosed :: Typeable t => Decode ('Closed d) t -> Decoder s t
485+
decodeClosed :: Typeable t => Decode (Closed d) t -> Decoder s t
485486
decodeClosed (Summands nm f) = decodeRecordSum nm (decodE . f)
486487
decodeClosed (KeyedD cn) = pure cn
487488
decodeClosed (RecD cn) = pure cn
@@ -569,7 +570,7 @@ mapCoder f x = Map f x
569570

570571
-- | Use `Cardano.Ledger.Binary.Coders.encodeDual` and `decodeDual`, when you want to
571572
-- guarantee that a type has both `EncCBOR` and `FromCBR` instances.
572-
decodeDual :: forall t. (EncCBOR t, DecCBOR t) => Decode ('Closed 'Dense) t
573+
decodeDual :: forall t. (EncCBOR t, DecCBOR t) => Decode (Closed Dense) t
573574
decodeDual = D decCBOR
574575
where
575576
-- Enforce EncCBOR constraint on t
@@ -579,22 +580,22 @@ decodeDual = D decCBOR
579580
-- =============================================================================
580581

581582
listDecodeA ::
582-
Typeable x => Decode ('Closed 'Dense) (Annotator x) -> Decode ('Closed 'Dense) (Annotator [x])
583+
Typeable x => Decode (Closed Dense) (Annotator x) -> Decode (Closed Dense) (Annotator [x])
583584
listDecodeA dx = D (sequence <$> decodeList (decode dx))
584585
{-# INLINE listDecodeA #-}
585586

586587
setDecodeA ::
587588
(Ord x, Typeable x) =>
588-
Decode ('Closed 'Dense) (Annotator x) ->
589-
Decode ('Closed 'Dense) (Annotator (Set x))
589+
Decode (Closed Dense) (Annotator x) ->
590+
Decode (Closed Dense) (Annotator (Set x))
590591
setDecodeA dx = D (decodeAnnSet (decode dx))
591592
{-# INLINE setDecodeA #-}
592593

593594
mapDecodeA ::
594595
(Ord k, Typeable k, Typeable v) =>
595-
Decode ('Closed 'Dense) (Annotator k) ->
596-
Decode ('Closed 'Dense) (Annotator v) ->
597-
Decode ('Closed 'Dense) (Annotator (Map.Map k v))
596+
Decode (Closed Dense) (Annotator k) ->
597+
Decode (Closed Dense) (Annotator v) ->
598+
Decode (Closed Dense) (Annotator (Map.Map k v))
598599
mapDecodeA k v = D (decodeMapTraverse (decode k) (decode v))
599600
{-# INLINE mapDecodeA #-}
600601

@@ -625,6 +626,6 @@ unusedRequiredKeys used required name =
625626
{-# NOINLINE unusedRequiredKeys #-}
626627

627628
-- | Prevent decoding until the 'Version' is at least the provided version.
628-
guardUntilAtLeast :: DecCBOR a => String -> Version -> Decode ('Closed 'Dense) a
629+
guardUntilAtLeast :: DecCBOR a => String -> Version -> Decode (Closed Dense) a
629630
guardUntilAtLeast errMessage v = D (unlessDecoderVersionAtLeast v (fail errMessage) >> decCBOR)
630631
{-# INLINE guardUntilAtLeast #-}

0 commit comments

Comments
 (0)