| Maintainer | hapytexeu+gh@gmail.com |
|---|---|
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Dep.Class.NonDeterministicWalkable
Contents
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
- class NonDeterministicWalkable f step | f -> step where
- nstep' :: f a -> step -> [f a] -> [f a]
- nstep :: f a -> step -> [f a]
- nstepValues' :: Foldable f => f a -> step -> [a] -> [a]
- nstepValues :: Foldable f => f a -> step -> [a]
- allNstep' :: Foldable g => g (f a) -> step -> [f a] -> [f a]
- allNstep :: Foldable g => g (f a) -> step -> [f a]
- allNstepValues :: Foldable f => [f a] -> step -> [a]
- nwalk :: Foldable g => f a -> g step -> [f a]
- nwalkValues :: (Foldable f, Foldable g) => f a -> g step -> [a]
- allNwalk :: Foldable g => [f a] -> g step -> [f a]
- allNwalkValues :: (Foldable f, Foldable g) => [f a] -> g step -> [a]
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.
Methods
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.
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.
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 |
Obtain the values stored in the Foldable after making a non-deterministic
step (which can result in zero, one or more new states).
Arguments
| :: Foldable f | |
| => f a | The initial state. |
| -> step | The non-deterministic step we take. |
| -> [a] | A list of values wrapped in the |
Obtain the values stored in the Foldable after making a non-deterministic
step (which can result in zero, one or more new states).
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.
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.
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.
Arguments
| :: Foldable g | |
| => f a | The initial state of the walk. |
| -> g step | A |
| -> [f a] | The resulting (possible) states after taking the walk. |
Arguments
| :: (Foldable f, Foldable g) | |
| => f a | The initial state of the walk. |
| -> g step | A |
| -> [a] | The resulting (possible) values that are stored in the final foldables. |
Arguments
| :: Foldable g | |
| => [f a] | The initial states for te walk. |
| -> g step | A |
| -> [f a] |
Make a non-deterministic walk with a collection of states that can result in multiple paths.
Arguments
| :: (Foldable f, Foldable g) | |
| => [f a] | The initial states for te walk. |
| -> g step | A |
| -> [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
| NonDeterministicWalkable Three ThreeValue Source # | |
Defined in Dep.Data.Three Methods nstep' :: Three a -> ThreeValue -> [Three a] -> [Three a] Source # nstep :: Three a -> ThreeValue -> [Three a] Source # nstepValues' :: Foldable Three => Three a -> ThreeValue -> [a] -> [a] Source # nstepValues :: Foldable Three => Three a -> ThreeValue -> [a] Source # allNstep' :: Foldable g => g (Three a) -> ThreeValue -> [Three a] -> [Three a] Source # allNstep :: Foldable g => g (Three a) -> ThreeValue -> [Three a] Source # allNstepValues :: Foldable Three => [Three a] -> ThreeValue -> [a] Source # nwalk :: Foldable g => Three a -> g ThreeValue -> [Three a] Source # nwalkValues :: (Foldable Three, Foldable g) => Three a -> g ThreeValue -> [a] Source # allNwalk :: Foldable g => [Three a] -> g ThreeValue -> [Three a] Source # allNwalkValues :: (Foldable Three, Foldable g) => [Three a] -> g ThreeValue -> [a] Source # | |