github.com/m4gshm/gollections@v0.0.13-0.20240331203319-a34a86e58a24/loop/sum/api.go (about)

     1  // Package sum provides sum.Of alias
     2  package sum
     3  
     4  import (
     5  	"github.com/m4gshm/gollections/c"
     6  	"github.com/m4gshm/gollections/loop"
     7  )
     8  
     9  // Of an alias of the loop.Sum
    10  func Of[T c.Summable](sum func() (T, bool)) T {
    11  	return loop.Sum(sum)
    12  }