Skip to content

Instantly share code, notes, and snippets.

@tomsmeding
Last active August 31, 2020 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tomsmeding/ef3cca5c4ebec4ea7e72167805d0450c to your computer and use it in GitHub Desktop.
Save tomsmeding/ef3cca5c4ebec4ea7e72167805d0450c to your computer and use it in GitHub Desktop.
Unused import warning is order-dependent?
module A1 (astuff) where
import C -- no warning!
import B
astuff :: Int
astuff = 10 + bstuff + cstuff
module A2 (astuff) where
import B
import C -- warning: unused import
astuff :: Int
astuff = 10 + bstuff + cstuff
module B (
module B,
module C
) where
import C
bstuff :: Int
bstuff = 100 + cstuff
module C where
cstuff :: Int
cstuff = 42
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
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