Skip to content

Split up Stack.Constants #1678

@sjakobi

Description

@sjakobi

As I found out in my PR, Stack.Constants doesn't only contain constants but also contains a bunch of helper functions for which it imports Stack.Types.Compiler, Stack.Types.Config, Stack.Types.PackageIdentifier and Stack.Types.PackageName. The problem is that these modules cannot in turn use any of the "actual" constants in Stack.Constants.

I propose that Stack.Constants become a "top-level" module that doesn't import any of the Stack.* modules, and that all the exports from Stack.Constants that depend on other Stack.* modules be moved elsewhere.

A few can even be deleted as they aren't used anywhere:

builtConfigFileFromDir
builtFileFromDir
configuredFileFromDir
defaultShakeThreads
userDocsDir
testBuiltFile
benchBuiltFile

For those "non-constant" exports that are currently used in only a single module, I'd propose that they could simply be moved inside that module.

After that there still remain the following "non-constant" functions that are used in more than one module:

distDirFromDir
distRelativeDir
hpcRelativeDir

Any ideas for those?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions