maybe

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reduce

func Reduce[A, B any](m *Maybe[A], b B, f F2[B, A, B]) B

Types

type Maybe

type Maybe[A any] struct {
	Value *A
}

func Bind

func Bind[A, B any](m *Maybe[A], f F1[A, *Maybe[B]]) *Maybe[B]

func Filter

func Filter[A any](m *Maybe[A], f F1[A, bool]) *Maybe[A]

func Just

func Just[A any](a A) *Maybe[A]

func Map

func Map[A, B any](f F1[A, B], m *Maybe[A]) *Maybe[B]

func Nothing

func Nothing[A any]() *Maybe[A]

func (*Maybe[A]) Default

func (m *Maybe[A]) Default(defaultValue A) A

Jump to

Keyboard shortcuts

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