Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
seborama committed Mar 30, 2022
1 parent 4d90509 commit 3f0b94d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions cast.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package fuego

// SC is a typed Stream cast function from a non-parameterised Stream[R] to a parameterised Stream[U].
// SC is a typed Stream cast function from a non-parameterised Stream[Any] to a parameterised Stream[U].
// SC receives a typed Stream[U].
//
// SC exists to address the current lack of support in Go for parameterised methods.
Expand All @@ -22,7 +22,7 @@ func SC[U any](from Stream[Any], to Stream[U]) Stream[U] {
return to
}

// C is a typed cast function from a non-parameterised Stream[R] to a parameterised type Stream[U].
// C is a typed cast function from a non-parameterised Stream[Any] to a parameterised type Stream[U].
// C receives a type U and creates a Stream[U].
//
// C exists to address the current lack of support in Go for parameterised methods.
Expand All @@ -45,7 +45,7 @@ func C[U any](from Stream[Any], to U) Stream[U] {
return toStream
}

// CC is a typed cast function from a non-parameterised Stream[R] to a parameterised type ComparableStream[U].
// CC is a typed cast function from a non-parameterised Stream[Any] to a parameterised type ComparableStream[U].
// CC receives a type U and creates a ComparableStream[U].
//
// CC exists to address the current lack of support in Go for parameterised methods and a performance issue with Go 1.18.
Expand All @@ -66,7 +66,7 @@ func CC[U Comparable](from Stream[Any], to U) ComparableStream[U] {
return ComparableStream[U]{toStream}
}

// MC is a typed cast function from a non-parameterised Stream[R] to a parameterised type MathableStream[U].
// MC is a typed cast function from a non-parameterised Stream[Any] to a parameterised type MathableStream[U].
// MC receives a type U and creates a MathableStream[U].
//
// MC exists to address the current lack of support in Go for parameterised methods and a performance issue with Go 1.18.
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// Example: "Map(Map(stream,f1),f2)" instead of "stream.Map(f1).Map(f2)".
//
// A syntactically lighter approach is provided with `SC`` and `C``.
// See functions `SC`` and `C `for casting Stream[R] to a typed Stream[T any].
// See functions `SC`` and `C `for casting Stream[Any] to a typed Stream[T any].
//
// Go 1.18 suffers from a performance issue:
//
Expand Down
6 changes: 3 additions & 3 deletions function.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type BinaryOperator[T any] func(T, T) T
// into a Stream[R].
type StreamFunction[T, R any] func(T) Stream[R]

// FlattenSlice is a StreamFunction that flattens a []T slice to a Stream[R] of its elements.
// FlattenSlice is a StreamFunction that flattens a []T slice to a Stream[Any] of its elements.
func FlattenSlice[T any](bufsize int) StreamFunction[[]T, Any] {
return func(el []T) Stream[Any] {
return NewStreamFromSlice(el, bufsize).StreamAny()
Expand Down Expand Up @@ -64,7 +64,7 @@ func Identity[T any](v T) T {
return v
}

// ToR is a basic Function that returns the original value passed to it, cast to an 'R' type.
func ToR[T any](v T) Any {
// ToAny is a basic Function that returns the original value passed to it, cast to an 'Any' type.
func ToAny[T any](v T) Any {
return v
}
2 changes: 1 addition & 1 deletion stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func (s Stream[T]) Distinct(hashFn func(T) uint32) Stream[T] {
return NewConcurrentStream(outstream, s.concurrency)
}

// StreamAny returns this stream as a Stream[R].
// StreamAny returns this stream as a Stream[Any].
func (s Stream[T]) StreamAny() Stream[Any] {
rCh := make(chan Any, cap(s.stream))

Expand Down

0 comments on commit 3f0b94d

Please sign in to comment.