Skip to content

forbidden imports: ["GHC.Internal.Base","GHC.Internal.Num"] on Set3b.hs #109

Description

@Aster89

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions