dep-software-0.1.0.0
Maintainerhapytexeu+gh@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

Dep.Class.NonDeterministicWalkable

Description

This module defines a typeclass NonDeterministicWalkable that specifies that one can walk through a non-deterministic data structure where a certain step can result in zero, one, or more new states.

Synopsis

Non determinstic steps and walks

class NonDeterministicWalkable f step | f -> step where Source #

A typeclass that specifies that we can walk through the given datastructure where steps can be non-deterministic and thus result in multiple possible states.

Minimal complete definition

nstep' | nstep

Methods

nstep' Source #

Arguments

:: f a

The given initial state where we make a non-determinstic step.

-> step

The step that we make, such step can result in zero, one or more new states.

-> [f a]

The list of tail elements added to the result.

-> [f a]

The list of the possible states with the new step.

Take a non-deterministic step that can result in multiple outcomes. One can specify a tail to make concatenating of lists more efficient.

nstep Source #

Arguments

:: f a

The given initial state where we make a non-determinstic step.

-> step

The step that we make, such step can result in zero, one or more new states.

-> [f a]

The list of the possible states with the new step.

Take a non-deterministic step that can result in multiple outcomes.

nstepValues' Source #

Arguments

:: Foldable f 
=> f a

The initial state.

-> step

The non-deterministic step we take.

-> [a]

The list of tail elements that will be added to the list.

-> [a]

A list of values wrapped in the Foldables after making a non-deterministic step.

Obtain the values stored in the Foldable after making a non-deterministic step (which can result in zero, one or more new states).

nstepValues Source #

Arguments

:: Foldable f 
=> f a

The initial state.

-> step

The non-deterministic step we take.

-> [a]

A list of values wrapped in the Foldables after making a non-deterministic step.

Obtain the values stored in the Foldable after making a non-deterministic step (which can result in zero, one or more new states).

allNstep' Source #

Arguments

:: Foldable g 
=> g (f a)

The given initial state where we make a non-determinstic step.

-> step

The step that we make, such step can result in zero, one or more new states.

-> [f a]

The list of tail elements added to the result.

-> [f a]

The list of the possible states with the new step.

Take the same non-deterministic step for all initial states. This can result in multiple outcomes. One can specify a tail to make concatenating of lists more efficient.

allNstep Source #

Arguments

:: Foldable g 
=> g (f a)

The given initial state where we make a non-determinstic step.

-> step

The step that we make, such step can result in zero, one or more new states.

-> [f a]

The list of the possible states with the new step.

Take the same non-deterministic step for all initial states. This can result in multiple outcomes.

allNstepValues Source #

Arguments

:: Foldable f 
=> [f a]

The initial states for te walk.

-> step

The non-deterministic step we make.

-> [a]

The resulting (possible) values that are stored in the final foldables.

Make a non-deterministic step for each state in the collection, and collect the data of the Foldables after making.

nwalk Source #

Arguments

:: Foldable g 
=> f a

The initial state of the walk.

-> g step

A Foldable of steps that we take.

-> [f a]

The resulting (possible) states after taking the walk.

nwalkValues Source #

Arguments

:: (Foldable f, Foldable g) 
=> f a

The initial state of the walk.

-> g step

A Foldable of steps that we take.

-> [a]

The resulting (possible) values that are stored in the final foldables.

allNwalk Source #

Arguments

:: Foldable g 
=> [f a]

The initial states for te walk.

-> g step

A Foldable of steps that we will take.

-> [f a] 

Make a non-deterministic walk with a collection of states that can result in multiple paths.

allNwalkValues Source #

Arguments

:: (Foldable f, Foldable g) 
=> [f a]

The initial states for te walk.

-> g step

A Foldable of steps that we will take.

-> [a]

The resulting (possible) values that are stored in the final foldables.

Make a non-deterministic walk with a collection of states that can result in multiple paths.

Instances

Instances details
NonDeterministicWalkable Three ThreeValue Source # 
Instance details

Defined in Dep.Data.Three