Documentation
¶
Overview ¶
Copyright 2022 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2022 IBM Corp.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func Alt[E, A any](that func() Either[E, A]) func(Either[E, A]) Either[E, A]
- func AltW[E, E1, A any](that func() Either[E1, A]) func(Either[E, A]) Either[E1, A]
- func Ap[E, A, B any](fa Either[E, A]) func(fab Either[E, func(a A) B]) Either[E, B]
- func Chain[E, A, B any](f func(a A) Either[E, B]) func(Either[E, A]) Either[E, B]
- func ChainOptionK[E, A, B any](onNone func() E) func(func(A) O.Option[B]) func(Either[E, A]) Either[E, B]
- func Eitherize0[R any](f func() (R, error)) func() Either[error, R]
- func Eitherize1[T1, R any](f func(t1 T1) (R, error)) func(t1 T1) Either[error, R]
- func Eitherize2[T1, T2, R any](f func(t1 T1, t2 T2) (R, error)) func(t1 T1, t2 T2) Either[error, R]
- func Fold[E, A, B any](onLeft func(e E) B, onRight func(a A) B) func(ma Either[E, A]) B
- func FromNillable[E, A any](e E) func(*A) Either[E, *A]
- func FromOption[E, A any](onNone func() E) func(O.Option[A]) Either[E, A]
- func FromPredicate[E, A any](pred func(a A) bool, onFalse func(a A) E) func(value A) Either[E, A]
- func GetOrElse[E, A any](onLeft func(E) A) func(Either[E, A]) A
- func IsLeft[E, A any](val Either[E, A]) bool
- func IsRight[E, A any](val Either[E, A]) bool
- func Map[E, A, B any](f func(a A) B) func(fa Either[E, A]) Either[E, B]
- func MapLeft[E, A, B any](f func(E) B) func(fa Either[E, A]) Either[B, A]
- func MapTo[E, A, B any](b B) func(Either[E, A]) Either[E, B]
- func Sequence2[E, T1, T2, R any](f func(T1, T2) Either[E, R]) func(Either[E, T1], Either[E, T2]) Either[E, R]
- func Sequence3[E, T1, T2, T3, R any](f func(T1, T2, T3) Either[E, R]) func(Either[E, T1], Either[E, T2], Either[E, T3]) Either[E, R]
- func SequenceArray[E, A any]() func([]Either[E, A]) Either[E, []A]
- func ToError[A any](e Either[error, A]) error
- func TraverseArray[E, A, B any](f func(A) Either[E, B]) func([]A) Either[E, []B]
- func WithResource[E, R, A any](onCreate func() Either[E, R], onRelease func(R) Either[E, any]) func(func(R) Either[E, A]) Either[E, A]
- type Either
- func Flatten[E, A any](mma Either[E, Either[E, A]]) Either[E, A]
- func Left[E, A any](value E) Either[E, A]
- func MonadAp[E, A, B any](fab Either[E, func(a A) B], fa Either[E, A]) Either[E, B]
- func MonadChain[E, A, B any](fa Either[E, A], f func(a A) Either[E, B]) Either[E, B]
- func MonadChainOptionK[E, A, B any](onNone func() E, ma Either[E, A], f func(A) O.Option[B]) Either[E, B]
- func MonadMap[E, A, B any](fa Either[E, A], f func(a A) B) Either[E, B]
- func MonadMapLeft[E, A, B any](fa Either[E, A], f func(E) B) Either[B, A]
- func MonadMapTo[E, A, B any](fa Either[E, A], b B) Either[E, B]
- func MonadSequence2[E, T1, T2, R any](e1 Either[E, T1], e2 Either[E, T2], f func(T1, T2) Either[E, R]) Either[E, R]
- func MonadSequence3[E, T1, T2, T3, R any](e1 Either[E, T1], e2 Either[E, T2], e3 Either[E, T3], ...) Either[E, R]
- func Of[E, A any](value A) Either[E, A]
- func Right[E, A any](value A) Either[E, A]
- func TryCatch[E, A any](f func() (A, error), onThrow func(error) E) Either[E, A]
- func TryCatchError[A any](f func() (A, error)) Either[error, A]
Constants ¶
This section is empty.
Variables ¶
This section is empty.