-
Notifications
You must be signed in to change notification settings - Fork 0
Haskell_conventions
-
Organize all code as Cabal packages.
-
Avoid circular module dependencies by introducing a module Types"packageName" for more complex packages (it is possibble to have a shortened PackageName here)
-
For any bigger library package introduce a module with all exports called Export"packageName". This module reexports all the stuff.
-
Use >>ghc-options: -Wall in the cabal file. (possibly with -fno-warn-name-shadowing -fno-warn-unused-do-bind) You may disable other warnings for a package (or for a module in a module header) Bring your code to zero warnings (this may be difficult when supporting different compiler and library versions with different imports)
-
Use upper bounds in the cabal file for the build depends: e.g. containers >=0.2 && <0.5,
- Add a module header in the following form:
{- |
Module : <File name or $Header$ to be replaced automatically>
Description : <optional short text displayed on contents page>
Copyright : (c) Authors ICS AG year
License : <license>
Maintainer : <email>
Stability : unstable | experimental | provisional | stable | frozen
Portability : portable | non-portable (<reason>)
<module description starting at first column>
-}
-
Add an export list to all modules (to make it easier to understand later, what is the interface)
-
Add a Haddock Comment at least for every exported entity
-
Use literal Haskell for writing papers, and not for production code
-
Add a type declaration for every toplevel function
( Open: How to name modules? How to insert modules in hierarchy? Have a top category for project (Iron.) or not? Make an exception for general utilities like Text. or use Iron.Text.***?)