Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change structure of examples, test, bench, and test-examples to follow the one from src #481

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tbagrel1
Copy link
Member

I noticed that there are some inconsistencies in the naming of test/bench executables of linear-base. In particular:

  • Most paths on mutable structures were in src/Data.<structure>.Mutable while the associated test/bench module was <exe>/Data.Mutable.<structure>
  • bench was missing a top Bench module name component, so names could conflict with the ones in src
  • some test modules for array were missing the Array module name component

Here's the exhaustive changelog:

    renamed:    bench/Data/Mutable/Array.hs       -> bench/Bench/Data/Array/Mutable.hs
    renamed:    bench/Data/Mutable/Quicksort.hs   -> bench/Bench/Data/Array/Mutable/Quicksort.hs
    renamed:    bench/Data/Mutable/HashMap.hs     -> bench/Bench/Data/HashMap/Mutable.hs
    modified:   bench/Main.hs (to adjust module names accordingly)

    renamed:    examples/Simple/Quicksort.hs      -> examples/Data/Array/Mutable/Quicksort.hs
    renamed:    examples/Simple/TopSort.hs        -> examples/Data/HashMap/Mutable/TopSort.hs
    modified:   examples/README.md (to adjust module names and add new ones)
    
    renamed:    test/Test/Data/Destination.hs     -> test/Test/Data/Array/Destination.hs
    renamed:    test/Test/Data/Mutable/Array.hs   -> test/Test/Data/Array/Mutable.hs
    renamed:    test/Test/Data/Polarized.hs       -> test/Test/Data/Array/Polarized.hs
    renamed:    test/Test/Data/Mutable/HashMap.hs -> test/Test/Data/HashMap/Mutable.hs
    renamed:    test/Test/Data/Mutable/Set.hs     -> test/Test/Data/Set/Mutable.hs
    renamed:    test/Test/Data/Mutable/Vector.hs  -> test/Test/Data/Vector/Mutable.hs
    modified:   test/Main.hs (to adjust module names accordingly)
    
    renamed:    test-examples/Test/Simple/Quicksort.hs -> test-examples/Test/Data/Array/Mutable/Quicksort.hs
    modified:   test-examples/Main.hs (to adjust module names accordingly)
    
    modified:   linear-base.cabal (to adjust module names accordingly)

@tbagrel1 tbagrel1 force-pushed the tbagrel1/test-bench-naming-consistency branch from 9c54126 to d54e402 Compare September 25, 2024 08:44
@aspiwack
Copy link
Member

I object to the renaming of the example/ subdirectory. These examples aren't meant to be sorted accorded to the what modules they exercise (indeed they exercise several). They are meant to be consumed by someone who's browsing the library and want to see it being deployed. So we need to optimise for this perusal.

Maybe you want to prefix them with Example anyway, just to make sure they don't clash with anything else. For future-proofing, I mean. But let's make sure that the examples are optimised for the reader, not for the library authors that we are.

The rest looks quite reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants