Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why having a separate module for types?

Why is it common to put classes and types definitions inside special Types module instead of placing them within corresponding namespace?

For example, let's take Config record from Yi source code. Why has it been decided to define it inside Yi.Types instead of Yi.Config?

like image 257
mariusz Avatar asked Feb 16 '15 22:02

mariusz


1 Answers

It's almost always done to avoid circular dependencies between modules. GHC handles them very poorly. They're theoretically allowed, but the mechanism is so painful they're nearly always avoided.

like image 123
Carl Avatar answered Sep 28 '22 06:09

Carl