Disabling the prelude
- 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
basefor exercise, and you need to avoid creating name clashes with the things that are already defined in
- If you are an opinionated expert and you dislike many of the things in
- If you are using the
RebindableSyntaxextension, which automatically disables the implicit prelude.
In this article, we show you several ways to remove the prelude from scope:
- With the
Preludewith an empty import list.
- By using module mixins.