When a GHCi session loads a file with {-# LANGUAGE NoImplicitPrelude #-}
directive, it will unload most of the Prelude definitions:
GHCi, version 8.10.6: https://www.haskell.org/ghc/ :? for help
Loaded GHCi configuration from /path/to/.ghci
[1 of 1] Compiling Main ( Main.hs, interpreted )
Ok, one module loaded.
<interactive>:1:1: error: Variable not in scope: main
> :i id
<interactive>:1:1: error: Not in scope: ‘id’
Some "fundamental" definitions stays imported, nevertheless:
> :i ->
type (->) :: * -> * -> *
data (->) a b
-- Defined in ‘GHC.Prim’
infixr -1 ->
> :i []
type [] :: * -> *
data [] a = [] | a : [a]
-- Defined in ‘GHC.Types’
> :i :
type [] :: * -> *
data [] a = ... | a : [a]
-- Defined in ‘GHC.Types’
infixr 5 :
>
What I want to know is: Is there more of such definitions available without importing Prelude? Is there a complete list of them, or a way to generate it?
A previous Google search for haskell no prelude
(expectedly) did not give something useful. The No import of Prelude page in Haskell Wiki mentions that:
There are some such for which even
-fno-implicit-prelude
isn't enough; I think these are documented in the "bugs" section of the GHC manual.
I did not find (or missed) any relevent information there; I don't know where to look in the rest of GHC User's Guide, either.