| Maintainer | hapytexeu+gh@gmail.com |
|---|---|
| Stability | experimental |
| Portability | POSIX |
| Safe Haskell | Safe |
| Language | Haskell2010 |
Dep.Class.Walkable
Contents
Description
This module defines a typeclass Walkable that specifies that one can walk through a deterministic
data structure for a given type of "steps".
Synopsis
- class Walkable f step | f -> step where
- step :: f a -> step -> f a
- stepValues' :: Foldable f => f a -> step -> [a] -> [a]
- stepValues :: Foldable f => f a -> step -> [a]
- allStep :: Functor g => g (f a) -> step -> g (f a)
- allStepValues' :: (Foldable f, Foldable g) => g (f a) -> step -> [a] -> [a]
- allStepValues :: (Foldable f, Foldable g) => g (f a) -> step -> [a]
- walk :: Foldable g => f a -> g step -> f a
- walkValues' :: (Foldable f, Foldable g) => f a -> g step -> [a] -> [a]
- allWalkValues :: (Foldable f, Foldable g, Functor g, Foldable h) => g (f a) -> h step -> [a]
- allWalk :: (Functor g, Foldable h) => g (f a) -> h step -> g (f a)
Deterministic steps and walks
class Walkable f step | f -> step where Source #
A typeclass that specifies that we can walk through a datastructure with steps.
Methods
Arguments
| :: f a | The original object where we will make a step. |
| -> step | The given step we take on the given data structure. |
| -> f a | The result of an object when we take one step. |
Take one step with the given step parameter, and return an object with the same type.
Arguments
| :: Foldable f | |
| => f a | The initial state. |
| -> step | The step that we take to move to another state. |
| -> [a] | A list of tail elements that can be added to the result. |
| -> [a] | The list of values from the modified state together with the given tail. |
Obtain the values of the item after making a step.
Arguments
| :: Foldable f | |
| => f a | The initial state. |
| -> step | The step that we take to move to another state. |
| -> [a] | The list of values from the modified state. |
Obtain the values of the item after making a step.
Arguments
| :: Functor g | |
| => g (f a) | The collection of items on which we apply a step. |
| -> step | The given step that will be applied. |
| -> g (f a) | A collection of items that are the result of making a step for each input item. |
Apply the same step for all the items in the given collection (functor) of items.
Arguments
| :: (Foldable f, Foldable g) | |
| => g (f a) | The initial states. |
| -> step | The step that we take to move to another state. |
| -> [a] | A list of tail elements that can be added to the result. |
| -> [a] | The list of values from the modified state together with the given tail. |
Obtain the values of the items after making the same step for all items.
Arguments
| :: (Foldable f, Foldable g) | |
| => g (f a) | The initial states. |
| -> step | The step that we take to move to another state. |
| -> [a] | The list of values from the modified state. |
Obtain the values of the items after making the same step for all items.
Arguments
| :: Foldable g | |
| => f a | The original object where we will make a step. |
| -> g step | The given foldable of steps we take on the given data structure. |
| -> f a | The result of an object when we take one step. |
Take a sequence of steps with the given list of steps.
Arguments
| :: (Foldable f, Foldable g) | |
| => f a | The initial state for which we will make a walk. |
| -> g step | A sequene of steps that describe the walk. |
| -> [a] | A list of tail elements that can be added at the end of the list. |
| -> [a] | The values found after making the a walk with the given |
Take a sequence of steps with the given list of steps and return the values out of the target state.
Arguments
| :: (Foldable f, Foldable g, Functor g, Foldable h) | |
| => g (f a) | The given collection of initial states over which a fold is made. |
| -> h step | A |
| -> [a] | The corresponding values that are wrapped in the target states. |
Instances
| Walkable Three Bool Source # | |
Defined in Dep.Data.Three Methods step :: Three a -> Bool -> Three a Source # stepValues' :: Foldable Three => Three a -> Bool -> [a] -> [a] Source # stepValues :: Foldable Three => Three a -> Bool -> [a] Source # allStep :: Functor g => g (Three a) -> Bool -> g (Three a) Source # allStepValues' :: (Foldable Three, Foldable g) => g (Three a) -> Bool -> [a] -> [a] Source # allStepValues :: (Foldable Three, Foldable g) => g (Three a) -> Bool -> [a] Source # walk :: Foldable g => Three a -> g Bool -> Three a Source # walkValues' :: (Foldable Three, Foldable g) => Three a -> g Bool -> [a] -> [a] Source # allWalkValues :: (Foldable Three, Foldable g, Functor g, Foldable h) => g (Three a) -> h Bool -> [a] Source # allWalk :: (Functor g, Foldable h) => g (Three a) -> h Bool -> g (Three a) Source # | |