cursed

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2024 License: CC0-1.0 Imports: 2 Imported by: 0

Documentation

Overview

Package cursed contains code that should never be used by anyone.

This place is a message... and part of a system of messages... pay attention to it!

Sending this message was important to us. We considered ourselves to be a powerful culture.

This place is not a place of honor... no highly esteemed deed is commemorated here... nothing valued is here.

What is here was dangerous and repulsive to us. This message is a warning about danger.

The danger is in a particular location... it increases towards a center... the center of danger is here... of a particular size and shape, and below us.

The danger is still present, in your time, as it was in ours.

The danger is to the body, and it can kill.

The form of the danger is an emanation of energy.

The danger is unleashed only if you substantially disturb this place physically. This place is best shunned and left uninhabited.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fold added in v1.10.0

func Fold[T any, U any](initial U, data []T, doer func(T, U) U) U

func Max added in v1.10.0

func Max[T Number](data []T) T

func Min added in v1.10.0

func Min[T Number](data []T) T

func Reduce added in v1.10.0

func Reduce[D any](data []D, doer func(D, D) D) D

func Sum added in v1.10.0

func Sum[T Number](data []T) T

func UseState

func UseState[T any](initial T) (func() T, func(T))

UseState is a copy of the useState monad in React/Preact.

This is a thread-safe stateful container that allows you to set and get a shared value.

Consumers should take care to NOT mutate any values in the fetched variable.

Types

type Mutex

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

Mutex is a generic locking container for Go much like Rust's std::sync::Mutex<T>.

It differs from a normal sync.Mutex because it guards a value instead of just being something you lock and unlock to guard another value. When you are done with the value, call the function return to re-lock the mutex.

func NewMutex

func NewMutex[T any](val T) *Mutex[T]

func (*Mutex[T]) Unlock

func (mu *Mutex[T]) Unlock() (T, func())

type Number added in v1.10.0

type Number interface {
	constraints.Float | constraints.Integer
}

Jump to

Keyboard shortcuts

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