-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADP-3350] Fix Cardano.Wallet.Read.Block.SlotNo
#4535
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
(Just one small suggestion)
deriving (Eq, Ord, Show, Generic) | ||
|
||
instance NoThunks SlotNo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be shortened to:
deriving (Eq, Ord, Show, Generic) | |
instance NoThunks SlotNo | |
deriving stock (Eq, Ord, Show, Generic) | |
deriving anyclass NoThunks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… but this is only shorter if you don't count the lines
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DeriveAnyClass #-}
that would have to be added at the top of the file. 🤓
I prefer to keep this code as is, as the intent is clear. In general, I only support new language extensions
- if they provide value with a good value/cost ratio
- and if they are established as part of the "team dialect of Haskell". (mental load)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -56,6 +56,8 @@ import qualified Ouroboros.Consensus.Shelley.Ledger as O | |||
type ConsensusBlock = O.CardanoBlock O.StandardCrypto | |||
|
|||
-- Family of era-specific block types | |||
-- TODO: The results of this type family should be ledger types, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid TODOs without a ticket attached ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. I have created ADP-3351 to track this, and recorded it here.
c3825df
to
c81fb4f
Compare
c81fb4f
to
82d1b6c
Compare
This pull request fixes the
Cardano.Wallet.Read.Block.SlotNo
module which encountered some difficulties with type class resolution and orphan instances, to the point where I suspected a compiler bug.I have also added
NoThunks
andGeneric
instances for theCardano.Wallet.Read.SlotNo
type in preparation for future pull requests.Issue Number
Discovered during ADP-3350