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

Dep.Class.Walkable

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

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.

Minimal complete definition

step | walk

Methods

step Source #

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.

stepValues' Source #

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.

stepValues Source #

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.

allStep Source #

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.

allStepValues' Source #

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.

allStepValues Source #

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.

walk Source #

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.

walkValues' Source #

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 Walkable in the Foldable.

Take a sequence of steps with the given list of steps and return the values out of the target state.

allWalkValues Source #

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 Foldable of steps that we will take for all states.

-> [a]

The corresponding values that are wrapped in the target states.

Obtain all the values the Foldable f spans after performing the same (Foldable) of steps on all the given intial states.

allWalk Source #

Arguments

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

The given collection of initial objects.

-> h step

The given foldable of steps that we take.

-> g (f a)

The result collection of items after applying the steps.

Instances

Instances details
Walkable Three Bool Source # 
Instance details

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 #