Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ToSeq (0.31 sec)

  1. test/typeparam/issue49893.dir/a.go

    // Copyright 2021 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package a
    
    type Option[T any] interface {
    	ToSeq() Seq[T]
    }
    
    type Seq[T any] []T
    
    func (r Seq[T]) Find(p func(v T) bool) Option[T] {
    	panic("")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Dec 02 07:04:05 UTC 2021
    - 306 bytes
    - Viewed (0)
  2. test/typeparam/issue50486.dir/goerror_fp.go

    		},
    		GetNext: func() T {
    			ret := r[idx]
    			idx++
    			return ret
    		},
    	}
    }
    
    type Iterator[T any] struct {
    	IsHasNext func() bool
    	GetNext   func() T
    }
    
    func (r Iterator[T]) ToSeq() Seq[T] {
    	ret := Seq[T]{}
    	for r.HasNext() {
    		ret = append(ret, r.Next())
    	}
    	return ret
    }
    
    func (r Iterator[T]) Map(f func(T) any) Iterator[any] {
    	return MakeIterator(r.HasNext, func() any {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 11 21:56:11 UTC 2022
    - 1.2K bytes
    - Viewed (0)
Back to top