-
Couldn't load subscription status.
- Fork 523
Open
Description
I think this is fundamentally the same issue as #76 , but it affects a different file, namely Set3b.hs.
I've submitted my solutions and they pass, but if I build on my machine I get this:
Mooc/Th.hs:27:14: warning: [GHC-63394] [-Wx-partial]
In the use of ‘head’
(imported from Data.List, but defined in GHC.Internal.List):
"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use "Data.List.NonEmpty"."
|
27 | | isUpper (head s) = return $ ConE n
| ^^^^
Mooc/Test.hs:177:20: warning: [GHC-63394] [-Wx-partial]
In the use of ‘head’
(imported from Data.List, but defined in GHC.Internal.List):
"This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use "Data.List.NonEmpty"."
|
177 | histogram vals = [(head xs, length xs) | xs <- group (sort vals)]
| ^^^^
===== EXERCISE 1
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== EXERCISE 2
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== EXERCISE 3
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== EXERCISE 4
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== EXERCISE 5
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== EXERCISE 6
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== EXERCISE 7
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== EXERCISE 8
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== EXERCISE 9
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== EXERCISE 10
*** Failed! Falsified (after 1 test):
forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"]
----- Fail
===== TOTAL
0000000000
0 / 10
It's worth mentioning I compile with cabal exec runhaskell Set3bTest.hs.
Metadata
Metadata
Assignees
Labels
No labels