facets

Random useful Crystal functions

facets

Some helpful functions that for the Crystal Languge

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      facets:
        github: wontruefree/facets
    
  2. Run shards install

Usage

require "facets"

Enumerable

reduce?

Similar to reduce?, however instead of returning nil when the input is empty, return the initial value of the accumulator.

([] of Int32).reduce?(10) { |acc, i| acc + i } # => 10

Contributors

Repository

facets

Owner
Statistic
  • 1
  • 0
  • 0
  • 0
  • 0
  • over 5 years ago
  • June 18, 2019
License

MIT License

Links
Synced at

Sun, 17 Nov 2024 11:06:55 GMT

Languages