Disabling the prelude
Contents
- In Haskell source files
- In GHCi
- Using module mixins
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 inPrelude
. - 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 show you several ways to remove the prelude from scope:
- With the
NoImplicitPrelude
extension. - By
import
ingPrelude
with an empty import list. - By using module mixins.