Hyperlinkv0.8.0-beta.28

Result

Result.succeedconsteffect/Result.ts:284
<A>(right: A): Result<A>

Creates a Result holding a Success value.

Details

  • Use when you have a value and want to lift it into the Result type
  • The error type E defaults to never

Example (Wrapping a value)

import { Result } from "effect"

const result = Result.succeed(42)

console.log(Result.isSuccess(result))
// Output: true
constructorsfailvoid_
Source effect/Result.ts:2841 lines
export const succeed: <A>(right: A) => Result<A> = result.succeed
Referenced by 41 symbols