package preface

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Preface_stdlib.ResultSource

Implementation for Result.t.

Result.t is like Either.t but it exist for semantic reasons. (Left and Right are not very specific on what are the valid and the invalid branch).

Type

Sourcetype ('a, 'b) t = ('a, 'b) result =
  1. | Ok of 'a
  2. | Error of 'b

Implementation

Bifunctor

module Bifunctor : Preface_specs.BIFUNCTOR with type ('a, 'b) t = ('a, 'b) t

Functor

module Functor : Preface_specs.INDEXED_FUNCTOR with type ('a, 'b) t = ('a, 'b) t

Alt

module Alt : Preface_specs.INDEXED_ALT with type ('a, 'b) t = ('a, 'b) t

Applicative

module Applicative : Preface_specs.INDEXED_APPLICATIVE with type ('a, 'b) t = ('a, 'b) t

Selective

module Selective : Preface_specs.INDEXED_SELECTIVE with type ('a, 'b) t = ('a, 'b) t

Monad

module Monad : Preface_specs.INDEXED_MONAD with type ('a, 'b) t = ('a, 'b) t

Foldable

module Foldable : Preface_specs.INDEXED_FOLDABLE with type ('a, 'b) t = ('a, 'b) t
Sourcemodule Mono (T : Preface_specs.Types.T0) : sig ... end

Additional functions

Additional functions to facilitate practical work with Result.t.

Sourceval pure : 'a -> ('a, 'b) t

Create a value from 'b to ('a, 'b) t.

Sourceval equal : ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a, 'b) t -> ('a, 'b) t -> bool

Equality between Result.t.

Sourceval pp : (Format.formatter -> 'a -> unit) -> (Format.formatter -> 'b -> unit) -> Format.formatter -> ('a, 'b) t -> unit

Formatter for pretty-printing for Result.t.

OCaml

Innovation. Community. Security.