monad

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2018 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package monad implements common monomorphic monads.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EitherStr

type EitherStr struct {
	Result string
	Err    error
}

EitherStr is a monomorphic Either monad specialized to string. I miss Haskell.

func (*EitherStr) Bind

func (r *EitherStr) Bind(f EitherStrFunc) *EitherStr

Bind lifts EitherStrFuncs into the EitherStr monad.

type EitherStrFunc

type EitherStrFunc func(previous string) (string, error)

EitherStrFunc defines monadic EitherStr functions.

type EitherVCS

type EitherVCS struct {
	Result cli.VCS
	Err    error
}

EitherVCS is an Either monad specialized to VCS.

func (*EitherVCS) BindVCS

func (r *EitherVCS) BindVCS(f EitherVCSFunc) *EitherVCS

BindVCS lifts EitherVCSFuncs into the EitherVCS monad.

type EitherVCSFunc

type EitherVCSFunc func(previous cli.VCS) (cli.VCS, error)

EitherVCSFunc defines monadic EitherVCS functions.

Jump to

Keyboard shortcuts

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