Skip to content

Please name builders approprietly #949

@Anton-Latukha

Description

@Anton-Latukha

There is a lot of:
nvThunk - type of names of entities.

But what it is?

It does what?

It is named as a literal/variable.

But it is a function.

The main point in the name of value is a noun, of a function - is a strong verb. There is no verb in these names - therefore they read not as functions but as values, that drives attention to what is nvThunk representation/type/value is & puzzles the reader with types & how NValue operates, & some of these nv* are really complex and take many arguments - but that is not that important, we generally need help people to be able to abstract from that. It just lifts the Haskell value into Nix value, it is a builder, which use mk.

mkThunk seems like a simpler & more to-the-point name. And is it needed to drive attention that it is Nix Value, maybe that is a detail, maybe to supply N/V, but it already comes from the Nix.Value module & has NValue in the signature, NValues are so prevalent (the main abstraction in the codebase) & these functions are of so general use in HNix - they do not need to mention this, as (generalizing) in HNix all builders are to be Nix language builders.


This question liked to:
#948
& developing minimal guidelines on naming conventions, as they are currently needed anyway & would be need even if to simplify names.

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactoringNo API breakages. Work that only makes code to be nicer or allows for future functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions