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.36 tracks/go/exercises/strain/example.go
trackler-2.2.1.35 tracks/go/exercises/strain/example.go
trackler-2.2.1.34 tracks/go/exercises/strain/example.go
trackler-2.2.1.33 tracks/go/exercises/strain/example.go
trackler-2.2.1.32 tracks/go/exercises/strain/example.go
trackler-2.2.1.31 tracks/go/exercises/strain/example.go
trackler-2.2.1.30 tracks/go/exercises/strain/example.go
trackler-2.2.1.29 tracks/go/exercises/strain/example.go
trackler-2.2.1.28 tracks/go/exercises/strain/example.go
trackler-2.2.1.27 tracks/go/exercises/strain/example.go
trackler-2.2.1.26 tracks/go/exercises/strain/example.go
trackler-2.2.1.25 tracks/go/exercises/strain/example.go
trackler-2.2.1.24 tracks/go/exercises/strain/example.go
trackler-2.2.1.23 tracks/go/exercises/strain/example.go
trackler-2.2.1.22 tracks/go/exercises/strain/example.go
trackler-2.2.1.21 tracks/go/exercises/strain/example.go
trackler-2.2.1.20 tracks/go/exercises/strain/example.go
trackler-2.2.1.19 tracks/go/exercises/strain/example.go
trackler-2.2.1.18 tracks/go/exercises/strain/example.go
trackler-2.2.1.17 tracks/go/exercises/strain/example.go