functor

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FoldFunc

type FoldFunc (func(typeclass.Ord, interface{}) interface{})

a function that analyze a recursive data structure and through use of a given combining operation

type Functor

type Functor interface {
	Null() bool                       // Test whether the structure is empty
	Length() int                      // Returns the size/length of a finite structure as an Int
	Minimum() typeclass.Ord           // The least element of a non-empty structure
	Maximum() typeclass.Ord           // The largest element of a non-empty structure
	Elem(typeclass.Ord) typeclass.Ord // Does the element occur in the structure

	Map(MapFunc) Functor                     // apply f to a structure then create a new structure
	Foldl(FoldFunc, interface{}) interface{} // Left-associative fold of a structure
	Foldr(FoldFunc, interface{}) interface{} // Right-associative fold of a structure
}

functional Functor

type MapFunc

type MapFunc (func(typeclass.Ord) typeclass.Ord)

MapFunc map a value to a new value

Jump to

Keyboard shortcuts

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