-
Notifications
You must be signed in to change notification settings - Fork 720
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
Remove NoImplicitPrelude from cardano-api #4832
Remove NoImplicitPrelude from cardano-api #4832
Conversation
b84c973
to
18416b5
Compare
18416b5
to
2129f33
Compare
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! We should remove cardano-prelude
in a follow up PR at some point
@@ -97,7 +96,6 @@ genCostModels = do | |||
Right alonzoCostModel -> | |||
Alonzo.CostModels . conv <$> Gen.list (Range.linear 1 3) (return alonzoCostModel) | |||
where | |||
conv :: [Alonzo.CostModel] -> Map Alonzo.Language Alonzo.CostModel |
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.
Why the removal of the type signature here?
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.
For some reason I got this error with the type signature:
gen/Gen/Cardano/Api.hs:99:33: error:
• Expected kind ‘* -> *’,
but ‘Map Alonzo.Language’ has kind ‘Metadatum’
• In the type signature:
conv :: [Alonzo.CostModel] -> Map Alonzo.Language Alonzo.CostModel
In an equation for ‘genCostModels’:
genCostModels
= do CostModel cModel <- genCostModel
lang <- genLanguage
case Alonzo.mkCostModel lang cModel of
Left err -> panic . Text.pack $ "genCostModels: " <> show err
Right alonzoCostModel
-> Alonzo.CostModels . conv
<$> Gen.list (Range.linear 1 3) (return alonzoCostModel)
where
conv :: [Alonzo.CostModel] -> Map Alonzo.Language Alonzo.CostModel
conv [] = mempty
conv (c : rest)
= Map.singleton (Alonzo.getCostModelLanguage c) c <> conv rest
|
99 | conv :: [Alonzo.CostModel] -> Map Alonzo.Language Alonzo.CostModel
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.
Ah, I need to qualify it:
conv :: [Alonzo.CostModel] -> Map.Map Alonzo.Language Alonzo.CostModel
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.
I put the type signature back in.
2129f33
to
5eb9989
Compare
We import Prelude explicitly from the majority of
cardano-api
modules. Removing this language extension makes this unnecessary and removes confusion about the status ofcardano-prelude
.