interfaces

package
v0.0.0-...-0e61b49 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 11 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inject

func Inject()

Types

type Alternative

type Alternative[F_, A any] interface {
	Empty() types.HKT[F_, A]
	Or(types.HKT[F_, A], types.HKT[F_, A]) types.HKT[F_, A]
}

type Applicative

type Applicative[F_, A, B any] interface {
	Apply(types.HKT[F_, func(A) B], types.HKT[F_, A]) types.HKT[F_, B]
}

type Apply

type Apply[F_, A, B any] interface {
	Product(types.HKT[F_, A], types.HKT[F_, B]) types.HKT[F_, tuple.Tuple2[A, B]]
}

type Async

type Async[A any] interface {
	Async(func() A) <-chan A
}

type Bind

type Bind[F_, A, B any] interface {
	FlatMap(types.HKT[F_, A], func(A) types.HKT[F_, B]) types.HKT[F_, B]
}

type Clone

type Clone[A any] interface {
	Clone(A) A
}

type Contextual

type Contextual[A any] interface {
	Context(context.Context) A
}

type Debugger

type Debugger[A any] interface {
	Debug(A) string
}

type Debugging

type Debugging interface {
	Debug() string
}

type Default

type Default[A any] interface {
	Default() A
}

type DefaultDebug

type DefaultDebug[A any] struct{}

func (*DefaultDebug[A]) Debug

func (dbg *DefaultDebug[A]) Debug(a A) string

type Enum

type Enum[A any] interface {
	Succ(A) A
	Pred(A) A
	ToEnum(int) A
	Range(A, A) collection.Iterator[A]
}

type Eq

type Eq[A, B any] interface {
	Equal(A, B) bool
}

type Foldable

type Foldable[F_, A, B any] interface {
	FoldLeft(types.HKT[F_, A], func(B, A) B, B) B
}

type Hash

type Hash[T any] interface {
	Hash(T) uint64
}

type HashInt

type HashInt struct{}

func (*HashInt) Hash

func (hash *HashInt) Hash(i int) uint64

type HashString

type HashString struct{}

func (*HashString) Hash

func (hash *HashString) Hash(s string) uint64

type Less

type Less[A any] interface {
	LessThan(A, A) bool
}

type LocalAsync

type LocalAsync[A any] struct{}

func (*LocalAsync[A]) Async

func (async *LocalAsync[A]) Async(f func() A) <-chan A

type Logger

type Logger interface {
	Log(string, ...any)
	Info(string, ...any)
	Warn(string, ...any)
	Error(string, ...any)
	Debug(string, ...any)
}

type Monad

type Monad[F_, A, B any] interface {
	Apply[F_, A, B]
	Bind[F_, A, B]
}

type Order

type Order[A any] interface {
	Compare(A, A) Ordering
}

type Ordering

type Ordering int
const (
	LessThan  Ordering = -1
	Equal     Ordering = 0
	GreatThan Ordering = 1
)

type Prelude

type Prelude[T comparable] struct{}

func (*Prelude[T]) Equal

func (eq *Prelude[T]) Equal(a, b T) bool

type PreludeLogger

type PreludeLogger struct {
	// contains filtered or unexported fields
}

func NewPreludeLogger

func NewPreludeLogger(w io.WriteCloser) *PreludeLogger

func (*PreludeLogger) Debug

func (logging *PreludeLogger) Debug(s string, args ...any)

func (*PreludeLogger) Error

func (logging *PreludeLogger) Error(s string, args ...any)

func (*PreludeLogger) Info

func (logging *PreludeLogger) Info(s string, args ...any)

func (*PreludeLogger) Log

func (logging *PreludeLogger) Log(s string, args ...any)

func (*PreludeLogger) Warn

func (logging *PreludeLogger) Warn(s string, args ...any)

type Pure

type Pure[F_, A any] interface {
	Pure(A) types.HKT[F_, A]
}

type Seq

type Seq[F_, A any] interface {
	SeqInterface[F_, A]
	Append(types.HKT[F_, A], A) types.HKT[F_, A]
	Concat(types.HKT[F_, A], types.HKT[F_, A]) types.HKT[F_, A]
	Count(types.HKT[F_, A], func(A) bool) int
	Find(types.HKT[F_, A], func(A) bool) maybe.Maybe[A]
}

type SeqDefault

type SeqDefault[F_, A any] struct {
	SeqInterface[F_, A]
}

func (*SeqDefault[F_, A]) Append

func (dsl *SeqDefault[F_, A]) Append(types.HKT[F_, A], A) types.HKT[F_, A]

type SeqInterface

type SeqInterface[F_, A any] interface {
	impl.Implement[types.HKT[F_, A], collection.Iterable[A]]

	Get(types.HKT[F_, A], int) maybe.Maybe[A]
	Len(types.HKT[F_, A]) int
}

type Sequence

type Sequence[F_, G_, B any] struct {
	Traversable[F_, G_, types.HKT[F_, B], B]
}

func (*Sequence[F_, G_, B]) Sequence

func (dsl *Sequence[F_, G_, B]) Sequence(
	container types.HKT[G_, types.HKT[F_, B]],
) types.HKT[F_, types.HKT[G_, B]]

type Summoner

type Summoner[A any] interface {
	Summon() maybe.Maybe[A]
	Given(A)
}

* For https://github.com/ireina7/summoner

func Instance

func Instance[A any]() Summoner[A]

type ToComparable

type ToComparable[A any, B comparable] interface {
	ToComparable(A) B
}

type Transformation

type Transformation[F_, G_, A any] interface {
	Transform(types.HKT[F_, A]) types.HKT[G_, A]
}

* Natural Transformation

type Traversable

type Traversable[F_, G_, A, B any] interface {
	// Apply[F_, A, B]
	Traverse(
		types.HKT[G_, A],
		func(A) types.HKT[F_, B],
	) types.HKT[F_, types.HKT[G_, B]]
}

type Visualize

type Visualize[F_, A any, M types.HKT[F_, A]] struct {
}

func (*Visualize[F_, A, M]) Visualize

func (v *Visualize[F_, A, M]) Visualize(xs types.HKT[F_, A]) M

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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