Why do we need a separate module for types?

Why is it common to define classes and types inside a module of special types instead of placing them in the corresponding namespace?

For example, take a Config entry from the Yi source code. Why was it decided to define it inside Yi.Types instead of Yi.Config ?

+7
design types design-patterns haskell
source share
1 answer

This is almost always done to avoid circular dependencies between modules. GHC handles them very poorly. They are theoretically resolved, but the mechanism is so painful that they are almost always avoided.

+9
source share

All Articles