data

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoValue = errors.New("data: no value")

Functions

This section is empty.

Types

type Data

type Data[A any] interface {
	// DEmpty returns true if the value is empty.
	DEmpty() bool

	// DValue returns the "first" value v from the sum type. If no value is
	// present it should panic with ErrNoValue.
	DValue() (v A)

	// DRest returns a Data interface that is scoped to the remaining
	// values. If no more values remain, then it should return nil.
	DRest() Data[A]
}

Data provides a general way to get values from a sum type.

Directories

Path Synopsis
sum
Package maybe provides a container type and utilities for optional values.
Package maybe provides a container type and utilities for optional values.
all

Jump to

Keyboard shortcuts

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