Etage-0.1.11: A general data-flow framework

Safe HaskellNone

Control.Etage.Sequence

Description

This module defines a Neuron which generates values based on a given sequence at a given interval. If it reaches the end of a sequence it initiates dissolving. You grow default version of it, which gives you an infinite source of random Ints at random interval of maximum length of 1 second, in Incubation by using something like:

 nerveRandom <- (growNeuron :: NerveOnlyFrom (SequenceNeuron Int)) defaultOptions

or for an infinite source of ones with same random interval:

 nerveOnes <- (growNeuron :: NerveOnlyFrom (SequenceNeuron Int)) (\o -> o { valueSource = repeat 1 })

This Neuron is an example of a Neuron with a parametrized type. Check also Control.Etage.Function for a Neuron with both receiving and sending Impulses types parametrized. It does not process any (receiving) Impulses.

Synopsis

Documentation

data SequenceNeuron v Source

Instances

Typeable1 SequenceNeuron 
Eq v => Eq (NeuronOptions (SequenceNeuron v)) 
Data v => Data (NeuronOptions (SequenceNeuron v)) 
Data v => Data (SequenceNeuron v) 
Ord v => Ord (NeuronOptions (SequenceNeuron v)) 
Read v => Read (NeuronOptions (SequenceNeuron v)) 
Show v => Show (NeuronOptions (SequenceNeuron v)) 
Typeable v => Show (SequenceNeuron v) 
(Real v, Random v, Show v, Typeable v) => Neuron (SequenceNeuron v)

A Neuron which generates values based on a given sequence at a given interval.

type SequenceForImpulse v = NeuronForImpulse (SequenceNeuron v)Source

Impulses for SequenceNeuron. This Neuron does not define any Impulses it would receive, NoImpulse.

type SequenceOptions v = NeuronOptions (SequenceNeuron v)Source

Options for SequenceNeuron. Those options are defined:

valueSource :: [v]
The list of values to send. If the end of the list is reached, Neuron initiates dissolving. Default is an infinite list of values of type v generated by the StdGen random generator.
intervalSource :: [Int]
The list of intervals between values. It is defined as a delay in microseconds before the next value is send. If the end of the list is reached, Neuron initiates dissolving. Default is a list of random delays with maximum length of 1 second generated by the StdGen random generator.