| ... | ... | @@ -135,7 +135,34 @@ after a few releases). |
|
|
|
We could therefore leave a `Prelude` module in the new
|
|
|
|
base package, but not put a `Prelude` module in any of the new packages.
|
|
|
|
Code moving to the new split packages would then need to import other
|
|
|
|
modules instead.
|
|
|
|
modules instead. It may make sense to keep some very common things, such
|
|
|
|
as the `Show` class (which is necessary whenever you want to define a
|
|
|
|
datatype deriving `Show`) in a module with a more generic name, such as
|
|
|
|
`Core` or `Base`. The name `Prelude` could also be used for this, but
|
|
|
|
another name may sound more natural.
|
|
|
|
|
|
|
|
### Desugaring
|
|
|
|
|
|
|
|
|
|
|
|
Currently, various pieces of Haskell syntax are desugared into
|
|
|
|
expressions that reference entities in the `Prelude`. Note that it is
|
|
|
|
not required that the entities are in scope, e.g.
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
import Prelude (IO, return)
|
|
|
|
|
|
|
|
main :: IO ()
|
|
|
|
main = do return ()
|
|
|
|
return ()
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
is valid even though `(>>)` is not in scope.
|
|
|
|
|
|
|
|
|
|
|
|
Therefore no change is necessary if the implicit import of Prelude
|
|
|
|
is dropped. If the module is also removed, then the report will have
|
|
|
|
to refer to the entities in other locations for its desugaring.
|
|
|
|
|
|
|
|
### Backwards compatibility
|
|
|
|
|
| ... | ... | |