monad

package
v0.0.0-...-c2e7105 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2017 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kleisli

func Kleisli(a, b func(i interface{}) Monad) func(i interface{}) Monad

Kleisli composition for monadic functions

Types

type BindFunc

type BindFunc func(interface{}) Monad

BindFunc is a function type used for Bind

type MPlus

type MPlus interface {
	Monad
	MZero() Monad
}

MPlus defines the interface for the MonadPlus class

type Monad

type Monad interface {
	AndThen(func(interface{}) Monad) Monad
	LogAndThen(func(interface{}) Monad, func(interface{})) Monad
	Return(i interface{}) Monad
}

Monad represents a generic monad

func FMap

func FMap(f func(interface{}) interface{}, m Monad) Monad

FMap applies a function inside of a monadic value

func Join

func Join(m Monad) Monad

Join takes a Monad (Monad (interface{})) and returns Monad (interface{})

Jump to

Keyboard shortcuts

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