Last active
August 31, 2020 11:53
-
-
Save tomsmeding/ef3cca5c4ebec4ea7e72167805d0450c to your computer and use it in GitHub Desktop.
Unused import warning is order-dependent?
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
module A1 (astuff) where | |
import C -- no warning! | |
import B | |
astuff :: Int | |
astuff = 10 + bstuff + cstuff |
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
module A2 (astuff) where | |
import B | |
import C -- warning: unused import | |
astuff :: Int | |
astuff = 10 + bstuff + cstuff |
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
module B ( | |
module B, | |
module C | |
) where | |
import C | |
bstuff :: Int | |
bstuff = 100 + cstuff |
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
module C where | |
cstuff :: Int | |
cstuff = 42 |
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
cabal-version: >=1.10 | |
name: haskell-import-order | |
version: 0.1.0.0 | |
author: Tom Smeding | |
maintainer: tom.smeding@gmail.com | |
build-type: Simple | |
executable haskell-import-order | |
main-is: Main.hs | |
other-modules: A1, A2, B, C | |
build-depends: base >=4.13 && <4.14 | |
default-language: Haskell2010 | |
ghc-options: -Wall |
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
module Main where | |
main :: IO () | |
main = putStrLn "Hello, Haskell!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment