MCPcopy
hub / github.com/samber/mo / Right

Function Right

either.go:23–28  ·  view source on GitHub ↗

Right builds the right side of the Either struct, as opposed to the Left side.

(value R)

Source from the content-addressed store, hash-verified

21
22// Right builds the right side of the Either struct, as opposed to the Left side.
23func Right[L any, R any](value R) Either[L, R] {
24 return Either[L, R]{
25 isLeft: false,
26 right: value,
27 }
28}
29
30// Either respresents a value of 2 possible types.
31// An instance of Either is an instance of either A or B.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected