-
Notifications
You must be signed in to change notification settings - Fork 102
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
support ghc-9.10 #1367
Merged
Merged
support ghc-9.10 #1367
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
6a9e2ae
support ghc-9.10
larskuhtz 9396bff
add internal library for unsafe base functions
larskuhtz 8ade427
remove redundant dependencies from cabal file
larskuhtz 6098d80
fix compiler warnings with GHC-9.10
larskuhtz 128cbce
update ci cabal builds
larskuhtz 16e6af9
upgrade setup-nix-with-cache
chessai 8074515
update hackage input
chessai fd731a2
install libc6 for cabal-cache
larskuhtz 346bc88
update hs-nix-infra
chessai 750d74c
Merge branch 'lars/ghc-9.10' of github.com:kadena-io/pact into lars/g…
larskuhtz cf9c59b
fix ci workflow
larskuhtz 8e5d9f4
remove redundant CI build matrix entry
larskuhtz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,56 @@ | ||||||
{-# LANGUAGE CPP #-} | ||||||
|
||||||
#if MIN_VERSION_base(4,20,0) | ||||||
{-# OPTIONS_GHC -Wno-x-partial #-} | ||||||
#endif | ||||||
|
||||||
|
||||||
-- | | ||||||
-- Module: unsafe.Data.Foldable.Unsafe | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
-- Copyright: Copyright © 2024 Kadena LLC. | ||||||
-- License: MIT | ||||||
-- Maintainer: Pact Team | ||||||
-- Stability: experimental | ||||||
-- | ||||||
-- This module provides unsafe versions for all functions in "Data.Foldable" | ||||||
-- that are either partial or return a 'Maybe' value. | ||||||
-- | ||||||
module Data.Foldable.Unsafe | ||||||
( | ||||||
-- * Unsafe versions of partial functions | ||||||
unsafeMaximum | ||||||
, unsafeMaximumBy | ||||||
, unsafeMinimum | ||||||
, unsafeMinimumBy | ||||||
|
||||||
-- * Unsafe versions of functions that return 'Maybe' values | ||||||
, unsafeFind | ||||||
) where | ||||||
|
||||||
import Data.Foldable | ||||||
|
||||||
import GHC.Stack | ||||||
|
||||||
-- -------------------------------------------------------------------------- -- | ||||||
-- Unsafe versions of partial functions | ||||||
|
||||||
unsafeMaximum :: HasCallStack => Foldable t => Ord a => t a -> a | ||||||
unsafeMaximum = maximum | ||||||
|
||||||
unsafeMaximumBy :: HasCallStack => Foldable t => (a -> a -> Ordering) -> t a -> a | ||||||
unsafeMaximumBy = maximumBy | ||||||
|
||||||
unsafeMinimum :: HasCallStack => (Foldable t, Ord a) => t a -> a | ||||||
unsafeMinimum = minimum | ||||||
|
||||||
unsafeMinimumBy :: HasCallStack => Foldable t => (a -> a -> Ordering) -> t a -> a | ||||||
unsafeMinimumBy = minimumBy | ||||||
|
||||||
-- -------------------------------------------------------------------------- -- | ||||||
-- Unsafe versions of functions that return Maybe | ||||||
|
||||||
unsafeFind :: HasCallStack => Foldable t => (a -> Bool) -> t a -> a | ||||||
unsafeFind a b = case find a b of | ||||||
Nothing -> error "Data.List.Unsafe.unsafeFind: not found" | ||||||
Just x -> x | ||||||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The build with
+build-tool
still has a bunch of-Wx-partial
warnings.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.
@edmundnoble sorry, I missed your comments when I hit the merge button (from the GitHub phone app). I'll address your comments in a follow up PR.