|
4 | 4 | {-# LANGUAGE GADTs #-} |
5 | 5 | {-# LANGUAGE LambdaCase #-} |
6 | 6 | {-# LANGUAGE NamedFieldPuns #-} |
7 | | -{-# LANGUAGE PatternSynonyms #-} |
8 | 7 | {-# LANGUAGE RankNTypes #-} |
9 | 8 | {-# LANGUAGE ScopedTypeVariables #-} |
10 | 9 | {-# LANGUAGE StandaloneDeriving #-} |
11 | 10 | {-# LANGUAGE TypeFamilies #-} |
12 | 11 | {-# LANGUAGE TypeOperators #-} |
13 | | -{-# LANGUAGE ViewPatterns #-} |
14 | | --- TODO Delete me when the patterns of this file are removed (they are the ones using deprecated - other - patterns) |
15 | | -{-# OPTIONS_GHC -Wno-deprecations #-} |
16 | 12 |
|
17 | 13 | -- | Blocks in the blockchain |
18 | 14 | module Cardano.Api.Block |
19 | 15 | ( -- * Blocks in the context of an era |
20 | 16 | Block (..) |
21 | | - , pattern Block |
22 | 17 | , BlockHeader (..) |
23 | 18 | , getBlockHeader |
24 | 19 | , getBlockTxs |
@@ -96,16 +91,6 @@ data Block era where |
96 | 91 | -> Consensus.ShelleyBlock (ConsensusProtocol era) (ShelleyLedgerEra era) |
97 | 92 | -> Block era |
98 | 93 |
|
99 | | --- | A block consists of a header and a body containing transactions. |
100 | | -{-# DEPRECATED Block "Use getBlockHeader instead " #-} |
101 | | -pattern Block :: BlockHeader -> [Tx era] -> Block era |
102 | | -pattern Block header txs <- (getBlockHeaderAndTxs -> (header, txs)) |
103 | | - |
104 | | -{-# COMPLETE Block #-} |
105 | | - |
106 | | -getBlockHeaderAndTxs :: Block era -> (BlockHeader, [Tx era]) |
107 | | -getBlockHeaderAndTxs block = (getBlockHeader block, getBlockTxs block) |
108 | | - |
109 | 94 | -- The GADT in the ShelleyBlock case requires a custom instance |
110 | 95 | instance Show (Block era) where |
111 | 96 | showsPrec p (ByronBlock block) = |
|
0 commit comments