maybe

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Just

func Just[T any](maybe Maybe[T]) T

func JustValid added in v0.0.3

func JustValid[T any](maybe Maybe[T]) (t T, v bool)

func ToPtr added in v0.0.2

func ToPtr[T any](m Maybe[T]) *T

func Valid

func Valid[T any](maybe Maybe[T]) bool

Types

type Maybe

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

func FromPtr added in v0.0.2

func FromPtr[T any](t *T) Maybe[T]

func NewJust

func NewJust[T any](v T) Maybe[T]

func NewNone

func NewNone[T any]() Maybe[T]

NewNone used for explicit none value

Jump to

Keyboard shortcuts

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