Skip to content

Nublist - #2167

Merged
23Skidoo merged 3 commits into
haskell:masterfrom
erikd:nublist
Oct 19, 2014
Merged

Nublist#2167
23Skidoo merged 3 commits into
haskell:masterfrom
erikd:nublist

Conversation

@erikd

@erikd erikd commented Oct 19, 2014

Copy link
Copy Markdown
Member

This set of three commits does the following:

  1. Adds @23Skidoo 's listUnion/listUnion/ordNub/ordNubRight function.
  2. Add the NubList type with tests.
  3. Uses NubList for the list fields of SavedConfig.

Three small, easily digestible commits.

erikd added 3 commits October 19, 2014 21:47
These functions are from Mikhail Glushenkov's cabal/ghc-options-union
branch.
A NubList is a list where all elements are unique, but are maintained in
their original order. The Monoid NubList's mappend implement is just:

    NubList xs `mappend` NubList ys = NubList . nub $ xs ++ ys

which preserves NubList's required properties (ordering and unique-ness
of elements) and meets the requirements of the Monoid laws (identity,
associativity and closure).
User config fields like 'remote-repo', 'extra-prog-path' and 'build-summary'
were lists, which mean that when two SavedConfig types were concatentated
the lists for these fields were concatenated, resulting in duplicate entries.
Duplicated entries in these fields simply don't make sense, so we swicth to
NubList for these fields.

Closes: haskell#2160
23Skidoo added a commit that referenced this pull request Oct 19, 2014
@23Skidoo
23Skidoo merged commit a256fb1 into haskell:master Oct 19, 2014
@23Skidoo

Copy link
Copy Markdown
Member

Merged, thanks!

@erikd
erikd deleted the nublist branch October 19, 2014 15:24
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