[Haskell-cafe] Organizing your code files

Henning Thielemann lemming at henning-thielemann.de
Thu Aug 12 06:12:26 UTC 2021


On Thu, 12 Aug 2021, Hécate wrote:

> Here is the layout I have seen most used:
> 
> module
>   ( export1
>   , export2
>   ) where

I prefer terminator style, because that simplifies re-ordering of lines:

module (
    export1,
    export2,
    ) where



> More generally at the project level, make sure you have a tree with few chokepoints. I encourage you to read this article
> https://www.parsonsmatt.org/2019/11/27/keeping_compilation_fast.html.

I second to avoid a big Types module. I propose to define one module per 
major type, name the module after the type, such that you can make use of 
qualification, like Text.concat, Window.open, Path.join, Matrix.transpose. 
You may still need Private modules in order to break import cycles and 
share secret definitions between the modules.


More information about the Haskell-Cafe mailing list