maybe

package
v0.0.0-...-8b02fee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package maybe provides support for working with optional values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Maybe

type Maybe[V any] struct {
	// contains filtered or unexported fields
}

A Maybe[V] represents an optional value of type V. The zero value for Maybe[V] is considered a "missing" value.

func New

func New[V any](value V) Maybe[V]

Create a new, non-empty Maybe with value 'value'.

func (Maybe[V]) Get

func (t Maybe[V]) Get() (value V, ok bool)

Get the underlying value, if any. ok is true iff the value was present.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL