Disabling the prelude

Contents
  • In Haskell source files
  • In GHCi

There are some reasons you might not want the entire contents of the prelude to be implicitly present everywhere:

  • If you are a learner and you want to reimplement parts of base for exercise, and you need to avoid creating name clashes with the things that are already defined in Prelude.
  • If you are an opinionated expert and you dislike many of the things in Prelude.
  • If you are using the RebindableSyntax extension, which automatically disables the implicit prelude.

In this article, we discuss how to use either NoImplicitPrelude or an import statement to remove the prelude from scope.