Skip to content

Code style guidance for new structure #202

Open
@hummy123

Description

@hummy123

Hi there.

I'm working on a functional AA tree, hoping to add it to this repository once tested, but I ran into a problem related to code style when implementing the IEnumerable interface.

Here is the file: https://github.com/hummy123/Functional-AA-Tree/blob/main/src/AaTree.fs .

The type at the top uses the module's (which comes after the type) toList function, which is enabled by the recursive namespace at the top.

However, this isn't best practice I feel (I like the "onion architecture" style where no piece at the top depends on any code written below), but the other choice I had was to code toList manually without using the fold function defined in the module, which I didn't like either.

I would have liked to add the toList definition and the namespaces at the end of the file where "type AaTree with..." is, but then I get a compile error FS0909 because an interface must be implemented at the start of the type definition. So I'm not sure what to do to contribute in a way that fits this repositories code style (haven't seen "namespace rec" on other files here).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions