option

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

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

func Fmap

func Fmap[T any, R any](opt Option[T], f func(x T) R) Option[R]

func None

func None[T any]() Option[T]

func Some

func Some[T any](x T) Option[T]

func (Option[T]) IsSome

func (opt Option[T]) IsSome() bool

func (*Option[T]) Replace

func (opt *Option[T]) Replace(x T)

func (Option[T]) ToString

func (opt Option[T]) ToString() string

func (Option[T]) Unwrap

func (opt Option[T]) Unwrap() T

Jump to

Keyboard shortcuts

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