-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These were uncovered by GHC 9.8, where -Wx-partial is included in -Wall.
- Loading branch information
1 parent
2de96b1
commit 072c8ce
Showing
5 changed files
with
35 additions
and
12 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Common (head_, tail_) where | ||
|
||
-- | Like 'head', but with a more specific error message in case the argument is | ||
-- empty. This is primarily defined to avoid incurring @-Wx-partial@ warnings | ||
-- whenever 'head' is used. | ||
head_ :: [a] -> a | ||
head_ (x:_) = x | ||
head_ [] = error "head_: Empty list" | ||
|
||
-- | Like 'tail', but with a more specific error message in case the argument is | ||
-- empty. This is primarily defined to avoid incurring @-Wx-partial@ warnings | ||
-- whenever 'tail' is used. | ||
tail_ :: [a] -> [a] | ||
tail_ (_:xs) = xs | ||
tail_ [] = error "tail_: Empty list" |
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