multiset.cr v0.5.0

Multiset (bag) implementation in Crystal

multiset

CI Documentation

A multiset (bag) implementation in Crystal.

Installation

Add this to your application's shard.yml:

dependencies:
  multiset:
    github: tcrouch/multiset.cr

Usage

require "multiset"

ms1 = Multiset{1, 1}
ms1 << 2                          # => Multiset{1, 1, 2}
ms1.merge [3, 4]                  # => Multiset{1, 1, 2, 3, 4}
ms2 = Multiset.new [2, 3, 4]
ms2.subset_of?(ms1)               # => true
ms1 & ms2                         # => Multiset{2, 3, 4}

Development

crystal spec

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

multiset.cr

Owner
Statistic
  • 4
  • 1
  • 1
  • 2
  • 0
  • almost 2 years ago
  • March 9, 2016
License

MIT License

Links
Synced at

Thu, 07 Nov 2024 17:14:13 GMT

Languages