Documentation ¶
Overview ¶
Package gomini is mininikanren in Go implemented using channels.
Index ¶
- func Bind(ctx context.Context, stream Stream, g Goal, res Stream)
- func FailureO(ctx context.Context, s *State, ss Stream)
- func Go(ctx context.Context, w *sync.WaitGroup, f func())
- func Mplus(ctx context.Context, s1, s2, res Stream)
- func Run[A any](ctx context.Context, s *State, g func(A) Goal) chan any
- func RunTake[A any](ctx context.Context, n int, s *State, g func(A) Goal) []any
- func SetMaxRoutines(ctx context.Context, max int) context.Context
- func SuccessO(ctx context.Context, s *State, ss Stream)
- type Goal
- type State
- type Stream
- type Var
- type VarCreator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Goal ¶
Goal is a function that takes a state and returns a stream of states.
func IfThenElseO ¶
IfThenElseO is a goal that evaluates the second goal if the first goal is successful, otherwise it evaluates the third goal.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is a product of a list of substitutions and a variable counter.
func NewState ¶
func NewState(varCreators ...VarCreator) *State
NewState returns an empty state. Provide optional VarCreator, which is used to give variables printable names for debugging purposes.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.