Sha256: 6c6dc41748a5cf4ab8f9c0ac9d948df1a53c0e624f60e2c4154f43967b3c1d9b

Contents?: true

Size: 599 Bytes

Versions: 170

Compression:

Stored size: 599 Bytes

Contents

package strain

const testVersion = 1

type Ints []int

func (s Ints) Keep(f func(int) bool) (r Ints) {
	for _, e := range s {
		if f(e) {
			r = append(r, e)
		}
	}
	return
}

func (s Ints) Discard(f func(int) bool) (r Ints) {
	for _, e := range s {
		if !f(e) {
			r = append(r, e)
		}
	}
	return
}

type Strings []string

func (s Strings) Keep(f func(string) bool) (r Strings) {
	for _, e := range s {
		if f(e) {
			r = append(r, e)
		}
	}
	return
}

type Lists [][]int

func (s Lists) Keep(f func([]int) bool) (r Lists) {
	for _, e := range s {
		if f(e) {
			r = append(r, e)
		}
	}
	return
}

Version data entries

170 entries across 170 versions & 1 rubygems

Version Path
trackler-2.2.1.56 tracks/go/exercises/strain/example.go
trackler-2.2.1.55 tracks/go/exercises/strain/example.go
trackler-2.2.1.54 tracks/go/exercises/strain/example.go
trackler-2.2.1.53 tracks/go/exercises/strain/example.go
trackler-2.2.1.52 tracks/go/exercises/strain/example.go
trackler-2.2.1.51 tracks/go/exercises/strain/example.go
trackler-2.2.1.50 tracks/go/exercises/strain/example.go
trackler-2.2.1.49 tracks/go/exercises/strain/example.go
trackler-2.2.1.48 tracks/go/exercises/strain/example.go
trackler-2.2.1.47 tracks/go/exercises/strain/example.go
trackler-2.2.1.46 tracks/go/exercises/strain/example.go
trackler-2.2.1.45 tracks/go/exercises/strain/example.go
trackler-2.2.1.44 tracks/go/exercises/strain/example.go
trackler-2.2.1.43 tracks/go/exercises/strain/example.go
trackler-2.2.1.42 tracks/go/exercises/strain/example.go
trackler-2.2.1.41 tracks/go/exercises/strain/example.go
trackler-2.2.1.40 tracks/go/exercises/strain/example.go
trackler-2.2.1.39 tracks/go/exercises/strain/example.go
trackler-2.2.1.38 tracks/go/exercises/strain/example.go
trackler-2.2.1.37 tracks/go/exercises/strain/example.go